# Can't install any packages

**URL:** <https://discourse.julialang.org/t/cant-install-any-packages/41626>\
**Category:** New to Julia\
**Tags:** question, package, plotting\
**Created:** [June 17, 2020, 8:33pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626 "2020-06-17T20:33:38Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![nstgc](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nstgc](https://discourse.julialang.org/u/nstgc)\
**Post date:** [June 17, 2020, 8:33pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/1 "2020-06-17T20:33:38Z")

</div>

I’ve been using Julia for six years. I moved to it from Python, but one thing I absolutely cannot do is install packages. So today when I saw a graph in Wolfram Alpha that didn’t look right (eventually I found the root issue seems to be that Wolfram Alpha thinks `arcsin(sin(x)/2))` is equal to `sin(x)/2`) I decided I’d install a graphing calculator program on my computer…except why should I do that when I have Julia?! because I can’t install Plots.

So today is the day I suck it up and ask.

Accord to Plots, you install it with `Pkg.add("Plots")` which results in  
Pkg.add(“Plots”)  
ERROR: UndefVarError: Pkg not defined  
Stacktrace:  
[1] top-level scope at REPL[2]:1

The Julia documentation says to enter the package manager with “]” (okay so far) and enter “add Plots”. That last part failed with “ERROR: no active project” except it most certainly [is an active project](https://juliahub.com/ui/Packages/Plots/ld3vC/1.4.2).

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [June 17, 2020, 8:41pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/2 "2020-06-17T20:41:36Z")

</div>

The `no active project` error refers to the term “project” as it’s used in the Pkg.jl documentation here: [4. Working with Environments · Pkg.jl](https://julialang.github.io/Pkg.jl/v1/environments/#Creating-your-own-projects-1)

I’m not sure how you got into a state where there is no project active in your package manager. What do you get if you run `]status` ?

And what version of Julia are you using? Have you done anything to your `~/.julia/config/startup.jl` file?

---

<div class="post-metadata">

**Author:** ![nstgc](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nstgc](https://discourse.julialang.org/u/nstgc)\
**Post date:** [June 17, 2020, 8:58pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/3 "2020-06-17T20:58:48Z")

</div>

```julia
pkg> status
ERROR: no active project

```

```julia
$ julia --version
julia version 1.4.2

```

```julia
$ cat ~/.julia/config/startup.jl
cat: ~/.julia/config/startup.jl: No such file or directory

```

I installed Julia from the official Arch Linux repo.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [June 17, 2020, 9:17pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/4 "2020-06-17T21:17:25Z")

</div>

It seems that you’re not the only one with problems with whatever Julia is being shipped by Arch: [Clean Julia 1.0 install on Arch Linux -- Can't add packages - #11 by crbinz](https://discourse.julialang.org/t/clean-julia-1-0-install-on-arch-linux-cant-add-packages/16931/11)

You could try following the steps in that post (touching `~/.julia/environments/v1.4/Project.toml` and ~/.julia/environments/v1.4/Manifest.toml` ) or you could try using the generic linux binaries from [Download Julia](https://julialang.org/downloads/) .

Using the generic linux binaries has consistently been the best approach in my experience, although I’m not on Arch so I can’t speak to that specifically.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [June 17, 2020, 9:18pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/5 "2020-06-17T21:18:19Z")

</div>

Actually, are you by any chance running `julia` as root?

---

<div class="post-metadata">

**Author:** ![nstgc](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nstgc](https://discourse.julialang.org/u/nstgc)\
**Post date:** [June 17, 2020, 9:26pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/6 "2020-06-17T21:26:18Z")

</div>

No. Just as a normal user.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [June 17, 2020, 9:27pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/7 "2020-06-17T21:27:34Z")

</div>

Can you download the tarball from [julialang.org](http://julialang.org), uncompress, and try run Julia from there? It maybe a packing bug.

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [June 17, 2020, 9:28pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/8 "2020-06-17T21:28:37Z")

</div>

I use Julia in Arch Linux. I never had any problems, but I do not use the distribution package, I download the tarball from the site, extract to `/opt` and make a link `sudo ln -s /opt/julia-1.4.2/bin/julia /usr/bin/julia`.

---

<div class="post-metadata">

**Author:** ![nstgc](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nstgc](https://discourse.julialang.org/u/nstgc)\
**Post date:** [June 17, 2020, 9:38pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/9 "2020-06-17T21:38:33Z")

</div>

I’ll be going through these, but first I wanted to report back that I tried the package manager for the Termux version of Julia just now.

First off, it includes the version number in the package manager prompt. I do not get this on Arch. Second, it `status` actually returns something.

The point is, it’s not me, it’s my system.

---

<div class="post-metadata">

**Author:** ![nstgc](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nstgc](https://discourse.julialang.org/u/nstgc)\
**Post date:** [June 17, 2020, 9:48pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/10 "2020-06-17T21:48:48Z")

</div>

`touch ~/.julia/environments/v1.4/Project.toml` didn’t work.

I downloaded the generic Linux binaries, extracted them to /opt and ran them with `/opt/julia/bin/julia` but that didn’t help.

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [June 17, 2020, 11:17pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/11 "2020-06-17T23:17:53Z")

</div>

> [@nstgc](#):
>
> Accord to Plots, you install it with `Pkg.add("Plots")` which results in  
> Pkg.add(“Plots”)  
> ERROR: UndefVarError: Pkg not defined  
> Stacktrace:  
> [1] top-level scope at REPL[2]:1

First, this error means you have not brought `Pkg` into namespace or define it. If it is a module, `using Pkg` brings it to the current module. Second, normal users usually do not have enough privilege to write under `/opt` folder.

---

<div class="post-metadata">

**Author:** ![nstgc](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nstgc](https://discourse.julialang.org/u/nstgc)\
**Post date:** [June 17, 2020, 11:35pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/12 "2020-06-17T23:35:23Z")

</div>

Sorry, I should have been more specific. I do have permission (I’m the owner) and I was trying `pkg> status`. And by that I don’t mean I typed `pkg>` but rather that is the prompt I get when in the package manager.

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [June 17, 2020, 11:45pm UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/13 "2020-06-17T23:45:24Z")

</div>

No need to be sorry. I cleary understood you have used package manager REPL at the end but I’ve just refered to the programmatical way of using it that you’ve tried at first. For the other issue, have you tried `]up` to get list of pakages?

---

<div class="post-metadata">

**Author:** ![nstgc](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nstgc](https://discourse.julialang.org/u/nstgc)\
**Post date:** [June 18, 2020, 12:00am UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/14 "2020-06-18T00:00:26Z")

</div>

Just now, I tried `]up` and it gives me the same error as with every other package manager command: “ERROR: no active project”.

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [June 18, 2020, 12:21am UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/15 "2020-06-18T00:21:01Z")

</div>

What does `Base.load_path_expand.(LOAD_PATH)` return? and `LOAD_PATH` also?  
I have something like

```julia
julia> Base.load_path_expand.(LOAD_PATH)
3-element Array{Union{Nothing, String},1}:
 nothing
 "/home/lutfullah/Programs/homedir/.julia/environments/v1.4/Project.toml"
 "/home/lutfullah/Programs/julia-1.4.1/share/julia/stdlib/v1.4"

julia> LOAD_PATH
3-element Array{String,1}:
 "@"
 "@v#.#"
 "@stdlib"

```

---

<div class="post-metadata">

**Author:** ![nstgc](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nstgc](https://discourse.julialang.org/u/nstgc)\
**Post date:** [June 18, 2020, 12:31am UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/16 "2020-06-18T00:31:22Z")

</div>

Huh. I take back what I said about this not being my fault.

```julia
julia> Base.load_path_expand.(LOAD_PATH)
1-element Array{String,1}:
 "/home/nstgc5/myScripts"

julia> LOAD_PATH
1-element Array{String,1}:
 "/home/nstgc5/myScripts"

```

I know I set that, and I’m guessing that’s part of the problem. But I don’t know what it should be or how to make it that way.

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [June 18, 2020, 12:35am UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/17 "2020-06-18T00:35:41Z")

</div>

Ok. We’re going somewhere. Any luck with `]` and

```julia
(@v1.4) pkg> help activate
  activate
  activate [--shared] path

  Activate the environment at the given path, or the home project environment if no path is specified. The active environment is
  the environment that is modified by executing package commands. When the option --shared is given, path will be assumed to be a
  directory name and searched for in the environments folders of the depots in the depot stack. In case no such environment exists
  in any of the depots, it will be placed in the first depot of the stack.

(@v1.4) pkg> activate
 Activating environment at `/home/lutfullah/Programs/homedir/.julia/environments/v1.4/Project.toml`

```

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [June 18, 2020, 12:51am UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/18 "2020-06-18T00:51:56Z")

</div>

You probably have set `JULIA_LOAD_PATH` as an environment variable check with `ENV["JULIA_LOAD_PATH"]` and you’ll see the path, otherwise it errors.

---

<div class="post-metadata">

**Author:** ![nstgc](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nstgc](https://discourse.julialang.org/u/nstgc)\
**Post date:** [June 18, 2020, 1:01am UTC](https://discourse.julialang.org/t/cant-install-any-packages/41626/19 "2020-06-18T01:01:05Z")

</div>

Actually, I had it in `~/.bashrc`. I vaguely remember putting it there. It’s now commented out, and…

```julia
julia> LOAD_PATH
3-element Array{String,1}:
 "@"
 "@v#.#"
 "@stdlib"

julia> Base.load_path_expand.(LOAD_PATH)
3-element Array{Union{Nothing, String},1}:
 nothing
 "/home/nstgc5/.julia/environments/v1.4/Project.toml"
 "/usr/share/julia/stdlib/v1.4"

```

And now the package manager works. Thank you!
