0.7 "using" statement

I have a bunch of types, structs and functions in a file I called ProjectModule.jl

Something like:

module ProjectModule
    using DataFrames
    abstract type A end
    mutable struct foo <: A
        a::Int64
    end 
    function f(x::foo)
       return x.a 
    end
   include("OtherStuff.jl")
   export SomethingElse
end

I used to be able to write

using ProjectModule

Now that errors with

ERROR: ArgumentError: Package ProjectModule not found in current path:
- Run `Pkg.add("ProjectModule")` to install the ProjectModule package.

import gives the same error. (I know these have different intended effects I was just trying to see if one of them would work.)

but

Pkg.add("ProjectModule")

gives an error because I have not created this a package, nor do I intend to.

I have looked at this issue and another maybe similar issue, but those do not seem to be the solution.

I am running Julia from within the folder containing the file ProjectModule.jl. Do I need to tell Julia to look in the directory Iā€™m working in for this file?

1 Like