# Using IJulia with existing Jupyter installation outwith Anaconda

**URL:** https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832
**Category:** New to Julia
**Tags:** package, jupyter
**Created:** [May 5, 2020, 8:56pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832 "2020-05-05T20:56:29Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![justinwalker](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@justinwalker](https://discourse.julialang.org/u/justinwalker)
#### Post date: [May 5, 2020, 8:56pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/1 "2020-05-05T20:56:29Z")

</div>

I installed Julia today and then tried to connect to my existing Jupyter installation; note that I don’t have, or wish to have Anaconda installed. The IJulia package adds and builds successfully but the ENV is missing and when I try to spin up a notebook or lab using IJulia I am prompted to continue with Conda. When declining I receive a bunch of errors.

I searched for some assistance and there is much reference to setting ENV[“JUPYTER”] to an existing jupyter executable, which I duly did but I’m still prompted to use Conda and I still receive the errors if I decline. Some further searching brought me to the IJulia GitHub repo and the documentation states that ENV should be set prior to adding or building the IJulia package. With this knowledge I did Pkg.rm(“IJulia”) and removed and then re-added the package after setting ENV[“JUPYTER”] = “/usr/local/bin/jupyter”. I try start a notebook using IJulia but I’m still prompted to use Conda and declining still fails.

This leads me to think that either the path to my existing Jupyter installation is incorrect or that because removing and re-adding doesn’t require building iJulia again, the path specified by ENV is ignored.

Any tips would be very gratefully received,

---

<div class="post-metadata">

### Author: ![travigd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/travigd/32/4746_2.png) [@travigd](https://discourse.julialang.org/u/travigd)
#### Post date: [May 5, 2020, 10:57pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/2 "2020-05-05T22:57:03Z")

</div>

You can launch Jupyter without using the Julia REPL and just create a new Julia notebook via the standard Jupyter interface (IJulia installs the kernel information to the right place regardless of whether or not you use the Conda version of Jupyter).

---

<div class="post-metadata">

### Author: ![leonardthomson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leonardthomson/32/52500_2.png) [@leonardthomson](https://discourse.julialang.org/u/leonardthomson)
#### Post date: [May 6, 2020, 9:09am UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/3 "2020-05-06T09:09:17Z")

</div>

Hi Justin,

I just solved the problem on my own laptop(Mac) after having some troubles.

Just to mention it:  
I tried this in a new virtual environment I only initialized for this!  
(If you need help setting up a new environment, please tell me.)

I will just tell you exactly what I did after activating the new environment.

Set ENV paths (find the right paths with “where python” in terminal and test them (after declaring) via “run(`$(ENV["PYTHON"]) --version`)” in Julia, analogous with jupyter):

ENV[“PYTHON”]=“/path/to/venv/bin/python”  
ENV[“JUPYTER”]= “/path/to/venv/bin/jupyter”

Add and build IJulia:

] add IJulia  
] build IJulia

(to reinsure) Check path to Jupyter:

using IJulia  
IJulia.JUPYTER

Now I updated Julia:

] update

Use IJulia and run notebook:

using IJulia  
notebook()

After updating Julia it was the first time I did not get an Conda import request (install Jupyter via Conda, y/n? [y]: ).

I don’t know wether it was the newly created environment or the Julia update that made it work.  
Hope this works for you as well.

Thomas

see also, for further inspiration:

> [@Add IJulia from the Jupiter installation in Conda](https://discourse.julialang.org/t/add-ijulia-from-the-jupiter-installation-in-conda/18125):
>
> I am not a programmer. I have only used Matlab and VBA for Excel. I installed Conda to begin learning R and Python. Having discovered Julia, I plan to learn R after Julia. In the documentation I read: To tell IJulia to use your own jupyter installation, you need to set ENV["JUPYTER"] to the path of the jupyter program before running Pkg.add("IJulia") (if jupyter is in your PATH, you can also just use ENV["JUPYTER"]="jupyter" ). I do not know how to set ENV["JUPYTER"] to the path …

> [@Problems with IJulia](https://discourse.julialang.org/t/problems-with-ijulia/29617):
>
> Hi I am using Julia 1.2. I have a pre-installed version of anaconda - So before building IJulia I do the following ENV["PYTHON"]="C:\\ProgramData\\Anaconda3\\python" ENV["JUPYTER"]="C:\\ProgramData\\Anaconda3\\Scripts\\jupyter" From hwat I understand this should direct Julia to fins Jupyter and Python ins the desired directories however - using IJulia IJulia.notebook() returns IJulia.notebook() install Jupyter via Conda, y/n? [y]: n I chose no given that I already have working installati…

---

<div class="post-metadata">

### Author: ![jfan](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jfan](https://discourse.julialang.org/u/jfan)
#### Post date: [May 8, 2020, 3:24pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/4 "2020-05-08T15:24:56Z")

</div>

I have a similar problem. I want to use the existing jupyter installation instead of downloading via Conda. So, I follow instructions:

ENV[“PYTHON”]=“C:\Python382”  
ENV[“JUPYTER”]=“C:\Python382\Scripts\python.exe”

Then,

Pkg.add(“IJulia”)  
using IJulia

When I check:

IJulia.JUPYTER  
“C:\Users\xxxxx\.julia\conda\3\Scripts\jupyter.exe”

Which is not what I set with ENV[“JUPYTER”] !!  
So, when I say:

notebook()  
install Jupyter via Conda, y/n? [y]: n  
ERROR: C:\Users\xxxxx.julia\conda\3\Scripts\jupyter.exe is not installed, cannot run notebook

Looks like I’m doing something wrong or IJulia insists on downloading and installing its own jupyter (which takes up \> 2 GB of space!)

---

<div class="post-metadata">

### Author: ![jfan](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jfan](https://discourse.julialang.org/u/jfan)
#### Post date: [May 8, 2020, 3:29pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/5 "2020-05-08T15:29:10Z")

</div>

Sorry there was a typo in my last message:  
I set it as:  
ENV[“PYTHON”]=“C:\Python382”  
ENV[“JUPYTER”]=“C:\Python382\Scripts\jupyter.exe"

and NOT  
ENV[“PYTHON”]=“C:\Python382”  
ENV[“JUPYTER”]=“C:\Python382\Scripts\python.exe”  
as I said in my previous posting.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [May 8, 2020, 3:36pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/6 "2020-05-08T15:36:31Z")

</div>

> [@jfan](#):
>
> `ENV["PYTHON"]="C:\Python382"`

This is triply wrong:

- IJulia doesn’t care about the `PYTHON` environment variable — that is only used to configure PyCall.jl (if you want to use your existing Python installation with PyCall).
- For PyCall, `PYTHON` should be set to path of `python.exe`, not a directory.
- `"C:\Python382"` won’t work in Julia because the backslash is interpreted as an [escape character](https://en.wikipedia.org/wiki/Escape_character). You either need to escape the backslash (`\\` insteadl of `\`) or use `raw"C:\Python382"`.

> `ENV["JUPYTER"]="C:\Python382\Scripts\python.exe"`

This is a path of `python.exe`, not `jupyter.exe`, which is why the Jupyter build process ends up ignoring it. (Note also the backslash problem.)

Note that you can check `Sys.isexecutable(ENV["JUPYTER"])` to make sure that you gave the path of an executable.

> [@jfan](#):
>
> Looks like I’m doing something wrong or IJulia insists on downloading and installing its own jupyter (which takes up \> 2 GB of space!)

Note that you can just launch `jupyter notebook` on your own — there is no need to use the `IJulia.notebook()` function at all if you know how to launch your own Jupyter process. Then it won’t matter whether you correctly told IJulia how to find your Jupyter installation.

---

<div class="post-metadata">

### Author: ![jfan](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jfan](https://discourse.julialang.org/u/jfan)
#### Post date: [May 8, 2020, 5:08pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/7 "2020-05-08T17:08:22Z")

</div>

Well, as I wrote back, python.exe was a typo. It was jupyter.exe ; also I used double backslash, unfortunately the online editor (discourse…) removed the double backslash and made it single. Since julia does not care about the PYTHON env. variable it is irrelevant if I set it or not. So, the problem still remains.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [May 8, 2020, 5:13pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/8 "2020-05-08T17:13:53Z")

</div>

> [@jfan](#):
>
> So, the problem still remains.

Did you check `Sys.isexecutable(ENV["JUPYTER"])` before running `build IJulia` as I suggested? Did `build IJulia` print any warning messages in its log?

In any case, as I wrote above, you can always launch Jupyter yourself. (Even without a Jupyter installed, IJulia installs its kernel configuration files where any Jupyter installation will find it.)

---

<div class="post-metadata">

### Author: ![jfan](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jfan](https://discourse.julialang.org/u/jfan)
#### Post date: [May 8, 2020, 5:26pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/9 "2020-05-08T17:26:36Z")

</div>

Thank you very much - your insight that IJulia kernel will find the Jupyter installation if it is in the system path made it easy. I now have it running. So, no need for another bulky Conda installation. Just make sure the system path has the python and jupyter executable (in my case: c:/Python382 and c:/Python382/Scripts). Again, much appreciated.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [May 8, 2020, 6:14pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/10 "2020-05-08T18:14:34Z")

</div>

> [@jfan](#):
>
> your insight that IJulia kernel will find the Jupyter installation if it is in the system path made it easy.

That’s not actually what I said — the Jupyter installation only needs to be in the system path if you want to just set `ENV["JUPYTER"] = "jupyter.exe"`; if you supply the correct absolute path to `ENV["JUPYTER"]` then the system path should be irrelevant.

---

<div class="post-metadata">

### Author: ![cet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cet/32/18549_2.png) [@cet](https://discourse.julialang.org/u/cet)
#### Post date: [October 22, 2020, 1:54pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/11 "2020-10-22T13:54:00Z")

</div>

Hello,

Maybe this can help.  
I solved the problem on Windows 10, Julia 1.5.2 by following these steps:

```julia
using Pkg
Pkg.add("Conda")
ENV["CONDA_JL_HOME"] = "C:\\Anaconda3\\Scripts\\jupyter.exe"
Pkg.build("Conda")

```

```julia
Pkg.add("IJulia")
Pkg.build("IJulia") # in case the precompilation did not take place
IJulia.JUPYTER # send "C:\\Anaconda3\\Scripts\\jupyter.exe"

notebook() # jupyter s'ouvre dans le navigateur

```

Except, I came across a DEAD Kernel Problem, which I solved by editing the following file :

`C:\Users\charl\AppData\Roaming\jupyter\kernels\julia-1.5\kernel.json`

Replace :  
`"--project=@."`

with :

`"--project=C:\\Users\\charl\\.julia\\environments\\v1.5\\Project.toml"`

Don’t forget to adapt all the paths to your setup.

---

<div class="post-metadata">

### Author: ![Alexander-Barth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexander-barth/32/3692_2.png) [@Alexander-Barth](https://discourse.julialang.org/u/Alexander-Barth)
#### Post date: [October 26, 2020, 8:22am UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/12 "2020-10-26T08:22:41Z")

</div>

This is quite interesting that this solves the problem for you. It would be interesting to start julia manually from the windows command line (cmd.exe) with the option `--project=@.` after changing the directory to the folder containing the notebooks. Maybe you will see a more helpful error message.

(Some students had also strange issues with IJulia, but I was not able to reproduce the error on my machine).

---

<div class="post-metadata">

### Author: ![cet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cet/32/18549_2.png) [@cet](https://discourse.julialang.org/u/cet)
#### Post date: [October 26, 2020, 11:06am UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/13 "2020-10-26T11:06:10Z")

</div>

After cd to notebook directory,

I ran :

`julia --project="." -E "println(Base.active_project()) ; using IJulia;notebook(dir=pwd())"`

This `println()` show current notebook directory. Then, search for Projet.toml. Since the file does not exist, IJulia select base env project.toml file (`" \\.julia\\environements\\........\Project.toml "`).  
And jupyter open in current dir and works.

I note like you, that when running `notebook()` in julia, no server logs appears, even if i set the debug option true.

Hope this help,  
cet

---

<div class="post-metadata">

### Author: ![Alexander-Barth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexander-barth/32/3692_2.png) [@Alexander-Barth](https://discourse.julialang.org/u/Alexander-Barth)
#### Post date: [November 4, 2020, 3:01pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/14 "2020-11-04T15:01:42Z")

</div>

OK, thank you for making this tests. I was hoping for some debugging information. I will try to make future tests should I get hold of a machine where this problem is visible.

---

<div class="post-metadata">

### Author: ![chas\_huett](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chas_huett/32/14858_2.png) [@chas\_huett](https://discourse.julialang.org/u/chas_huett)
#### Post date: [March 30, 2021, 3:08pm UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/15 "2021-03-30T15:08:14Z")

</div>

thank you. this change to the kernel.json worked for me. clicking the “Jupyter notebook” icon produces a notebook wherein the Julia 1.6.0 kernel “lives” and no longer presents the dead kernel error.

---

<div class="post-metadata">

### Author: ![nyambol](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nyambol/32/30533_2.png) [@nyambol](https://discourse.julialang.org/u/nyambol)
#### Post date: [November 5, 2021, 1:43am UTC](https://discourse.julialang.org/t/using-ijulia-with-existing-jupyter-installation-outwith-anaconda/38832/16 "2021-11-05T01:43:20Z")

</div>

It just should not be this much work to install the Julia kernel. R takes 1 minute and just works. No one should have to install bloataconda in order to get Julia working.

After removing & reinstalling IJulia 3 times, and getting no kernel in the notebook, in desperation I try a launch from Julia REPL. (Those referenced paths do exist, BTW).

```julia
julia> IJulia.notebook()
[ Info: running `'C:\Python310\Scripts' notebook`
ERROR: IOError: could not spawn setenv(`'C:\Python310\Scripts' notebook`; dir="C:\\Users\\micha"): no such file or directory (ENOENT)
Stacktrace:
 [1] _spawn_primitive(file::String, cmd::Cmd, stdio::Vector{Any})
   @ Base .\process.jl:99
 [2] #637
   @ .\process.jl:112 [inlined]
 [3] setup_stdios(f::Base.var"#637#638"{Cmd}, stdios::Vector{Any})
   @ Base .\process.jl:196
 [4] _spawn
   @ .\process.jl:111 [inlined]
 [5] run(::Cmd; wait::Bool)
   @ Base .\process.jl:443
 [6] launch(cmd::Cmd, dir::String, detached::Bool)
   @ IJulia C:\Users\micha\.julia\packages\IJulia\e8kqU\src\jupyter.jl:54
 [7] notebook(; dir::String, detached::Bool)
   @ IJulia C:\Users\micha\.julia\packages\IJulia\e8kqU\src\jupyter.jl:97
 [8] notebook()
   @ IJulia C:\Users\micha\.julia\packages\IJulia\e8kqU\src\jupyter.jl:95
 [9] top-level scope
   @ REPL[6]:1

```

Where did those wrong paths come from? Why is it running the wrong path for the notebook? I don’t know.

But wait, there’s more. I exit the REPL and launch Jupyter normally and - the Julia kernel is there. I test it in a notebook and it’s working.

I know y’all are going to shake your heads because I’m on Windows, but really - it just shouldn’t be this hard.
