# Install package of Julia in Cocalc

**URL:** https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239
**Category:** General Usage
**Created:** [January 11, 2020, 4:03pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239 "2020-01-11T16:03:30Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [January 11, 2020, 4:03pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/1 "2020-01-11T16:03:30Z")

</div>

Hi community,  
Do anyone have a suggested instruction for doing so?  
My attempts are listed as below. As there is no existent manual for installing package of Julia in Cocalc, I attempted to read an equivalent for R.

" The install command will not work unless you [upgrade your project](https://doc.cocalc.com/project-settings.html#project-upgrades) to have internet access."  
With internet access (checked in my Cocalc project setting) I should be able to install package directly, but:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/5/3520d1767fcc9eaa3fbfdeee2afb6b0a77c85a75.png)  
It doesn’t work. The I tried the " download the tarball of the R package to your own machine, and [upload](https://doc.cocalc.com/howto/upload.html) it to your project. Then, you can tell R to install the package directly from there as a local file."  
But for Julia I get stuck in the second step.

---

<div class="post-metadata">

### Author: ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)
#### Post date: [January 11, 2020, 4:09pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/2 "2020-01-11T16:09:33Z")

</div>

Either start with

```julia
using Pkg
Pkg.add("Plots")
...

```

or  
type ] than you see:  
`(v1.3) pkg>`  
and there use  
`(v1.3) pkg> add Plots`

---

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [January 11, 2020, 4:12pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/3 "2020-01-11T16:12:33Z")

</div>

Thx this worked but with new error.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/0/5091e1b3bbad5bb4797662fc02020fc44ee54dcf.png)

---

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [January 11, 2020, 5:05pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/4 "2020-01-11T17:05:27Z")

</div>

The failed attempts of change the read-only file to write-access are listed.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/2/52af6d3f8ec2be20b7cfa169708bdd0aeadbd2b3.png)  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/8/389307ff66188be055991c8ad83c3df19c139edc.png)

---

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [January 11, 2020, 5:33pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/5 "2020-01-11T17:33:46Z")

</div>

git clone

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/5/650802659f93987d433e7e2a47d10dd1746d0697.png)

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/1/21c6bce2f927abebe13fc336fd0abc01c72c899c.png)  
By ‘gksqt’ I googled=\> saying need to update GR  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/2/92c3d2227989df31f40f74dc24438fcdccd74f43.png)  
while this error remains questioned ([Pkg: GtkTextUtils in manifest but not in project](https://discourse.julialang.org/t/pkg-gtktextutils-in-manifest-but-not-in-project/28447)).

To summarize, Plots.jl file appeared in my Cocalc project (done by git clone) but cannot be used in Julia.

---

<div class="post-metadata">

### Author: ![ha\_sch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ha_sch/32/4404_2.png) [@ha\_sch](https://discourse.julialang.org/u/ha_sch)
#### Post date: [January 11, 2020, 5:49pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/6 "2020-01-11T17:49:11Z")

</div>

Hi, on CoCalc, there is a global setup with a couple of pre-installed julia packages. There is a depot environment variable set for this:

```julia
echo $JULIA_DEPOT_PATH 
/home/user/.julia:/ext/julia/depot/

```

However, your attempts try to change something there. You can specify to create your own “project” in your home directory, where you have read-write access. I.e. try to do this:

```julia
export JULIA_PROJECT=/home/user/.julia/environment/v1.3

```

and then start julia, etc.

Beyond that, I don’t know how to deal with this. Maybe someone here has a good idea how to support global package installs and still provide a way to install packages in your home dir. Btw: the above `JULIA_PROJECT` variable is also set automatically when you run the julia 1.3 kernel in a jupyter notebook.

---

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [January 13, 2020, 12:00am UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/7 "2020-01-13T00:00:28Z")

</div>

Thank you. I did as instructed, but the error still is using the former read-only file to install package). Is there any way to change the pathway/file for installing packages? There are some basic packages like Plots not included in the pre-installed package TAT.

---

<div class="post-metadata">

### Author: ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)
#### Post date: [January 13, 2020, 1:20am UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/8 "2020-01-13T01:20:39Z")

</div>

Did you install package matplotlib?  
sudo apt install python3-matplotlib

---

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [January 13, 2020, 9:57am UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/9 "2020-01-13T09:57:24Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/d/b/db7b0c17c6d9f119ea0a7c036f366bdf5a926736.png)  
Thank you. The problem could be that the file is read-only.

---

<div class="post-metadata">

### Author: ![orialb](https://avatars.discourse-cdn.com/v4/letter/o/65b543/32.png) [@orialb](https://discourse.julialang.org/u/orialb)
#### Post date: [January 13, 2020, 10:37am UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/10 "2020-01-13T10:37:17Z")

</div>

I sometimes also have problems installing packages on our cluster (not CoCalc) even though my default environment is at my home folder. Not sure what is your problem exactly, but for me usually it works to install the packages in a project specific environment (which is anyway good practice).  
Maybe try something like this in the REPL:

```julia
(v1.3) pkg> activate /home/user/my_project

(my_project) pkg> add PackageName

```

---

<div class="post-metadata">

### Author: ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)
#### Post date: [January 13, 2020, 2:26pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/11 "2020-01-13T14:26:22Z")

</div>

Do you have permission to the /ext directory? Usually packages are installed in the /home/user/.julia… directory.

---

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [January 13, 2020, 4:44pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/12 "2020-01-13T16:44:03Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/b/4/b41371db87e98d19787cc0c7726ab3fff931cd7b.png)

This nailed it. Thank you!

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/6/b6eab978b4adde3a980da354ee04310b9fc54e10.png)  
only plot cannot be supported in Cocalc.

---

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [January 13, 2020, 4:47pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/13 "2020-01-13T16:47:42Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/4/3/43f85094980c61b97101401c7742971dc9dcd4ca.png)

I can view it (list of pre-installed package) but not the administrator.

---

<div class="post-metadata">

### Author: ![orialb](https://avatars.discourse-cdn.com/v4/letter/o/65b543/32.png) [@orialb](https://discourse.julialang.org/u/orialb)
#### Post date: [January 13, 2020, 5:31pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/14 "2020-01-13T17:31:10Z")

</div>

Did you do `using Plots` before trying the plot command?

---

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [January 13, 2020, 5:43pm UTC](https://discourse.julialang.org/t/install-package-of-julia-in-cocalc/33239/15 "2020-01-13T17:43:44Z")

</div>

Yes included. The screenshot is just for showing the output.
