Problem with Pkg: cannot be found in current path

Hi! I am working on Julia 1.0.3. I am using Atom in Ubuntu 16. Today I upgraded Atom and julia-client packages and after it Julia repl cannot start. Following error message is displayed:

Hold on tight while we are installing some packages for you.
This should only take a few seconds...

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

Some time ago I noticed that same issue is also with running Julia in normal terminal. I didn’t care though because if needed I could open terminal via Atom and it worked fine.

julia> using Pkg
ERROR: ArgumentError: Package Pkg not found in current path:
- Run `import Pkg; Pkg.add("Pkg")` to install the Pkg package.

I looked at similar threads, but couldn’t find the solution. Thanks for help!

Have you messed with the LOAD_PATH variable (or the JULIA_LOAD_PATH environment variable)? What is the output of

julia> LOAD_PATH

and

julia> Base.load_path()

?

I might have messed with it. The outputs are:

julia> LOAD_PATH
3-element Array{String,1}:
 "/home/pgorski/Desktop/programming/julia/curheider" 
 "/home/pgorski/Desktop/programming/julia/curheider" 
 "/home/pgorski/Desktop/programming/julia/opusheider"
julia> Base.load_path()
2-element Array{String,1}:
 "/home/pgorski/Desktop/programming/julia/curheider" 
 "/home/pgorski/Desktop/programming/julia/opusheider"

Following fredrikekre question, I found the thread: JULIA_LOAD_PATH replace load path instead of append to it. Reading it, I checked my .bashrc file and found out I am overwriting JULIA_LOAD_PATH variable. So I added colon and everything is fine.

1 Like