# IJulia... after removing Python

**URL:** https://discourse.julialang.org/t/ijulia-after-removing-python/29111
**Category:** General Usage
**Created:** [September 24, 2019, 1:34pm UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111 "2019-09-24T13:34:47Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [September 24, 2019, 1:34pm UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/1 "2019-09-24T13:34:47Z")

</div>

I recently had problems with running some Python code (Spyder didn’t find the kernel, etc. – maybe because I had several Python versions installed). So in the end, I deleted every Python version on my computer, and re-installed the latest Python version from Anaconda.

Next, I checked how this influenced Julia (Julia v. 1.1, Windows 10). So now, I can import IJulia (`julia> using IJulia` seems to work). What has changed is that when I try to start up `jupyterlab()`, I am asked to `install Jupyter via Conda` – I guess that removing Python installations has removed Jupyter for IJulia…

```julia
julia> using IJulia

julia> jupyterlab()
install Jupyter via Conda, y/n? [y]: y
[ Info: Downloading miniconda installer ...
ERROR: failed process: Process(`'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe' -Version 3 -NoProfile -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; (New-Object System.Net.Webclient).DownloadFile('https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Windows-x86_64.exe', 'C:\Users\user_name\.julia\conda\3\installer.exe')"`, ProcessExited(1)) [1]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at .\error.jl:42
 [2] pipeline_error at .\process.jl:785 [inlined]
 [3] download(::String, ::String) at .\download.jl:20
 [4] _install_conda(::String, ::Bool) at C:\Users\user_name\.julia\packages\Conda\kLXeC\src\Conda.jl:160
 [5] _install_conda(::String) at C:\Users\user_name\.julia\packages\Conda\kLXeC\src\Conda.jl:152
 [6] runconda(::Cmd, ::String) at C:\Users\user_name\.julia\packages\Conda\kLXeC\src\Conda.jl:111
 [7] #add#1(::String, ::Function, ::String, ::String) at C:\Users\user_name\.julia\packages\Conda\kLXeC\src\Conda.jl:184
 [8] add at C:\Users\user_name\.julia\packages\Conda\kLXeC\src\Conda.jl:183 [inlined] (repeats 2 times)
 [9] find_jupyter_subcommand(::String) at C:\Users\user_name\.julia\packages\IJulia\fRegO\src\jupyter.jl:23
 [10] #jupyterlab#9(::String, ::Bool, ::Function) at C:\Users\user_name\.julia\packages\IJulia\fRegO\src\jupyter.jl:100
 [11] jupyterlab() at C:\Users\user_name\.julia\packages\IJulia\fRegO\src\jupyter.jl:99
 [12] top-level scope at none:0

```

Anyone has an idea of what goes wrong?

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [September 24, 2019, 1:37pm UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/2 "2019-09-24T13:37:30Z")

</div>

You removed jupyter as part of your python purge. Note that jupyter is written in python and requires python to run. Just let julia install its own version and have control over it.

---

<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: [September 24, 2019, 1:56pm UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/3 "2019-09-24T13:56:36Z")

</div>

You are getting some kind of download error, but there is no error message beyond “failed process” so it is hard to tell what is going wrong. You could try running the same command in a Windows console:

```julia
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Version 3 -NoProfile -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; (New-Object System.Net.Webclient).DownloadFile('https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Windows-x86_64.exe', 'C:\Users\user_name\.julia\conda\3\installer.exe')"

```

and see if it gives a more informative error message.

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [September 25, 2019, 6:24am UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/4 "2019-09-25T06:24:36Z")

</div>

OK: I started a console window, did `cd c:\windows\system32\windowspowershell\v1.0`, and then issued command `powershell.exe -Version 3 -NoProfile -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; (New-Object System.Net.Webclient).DownloadFile('https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Windows-x86_64.exe', 'C:\Users\user_name\.julia\conda\3\installer.exe')"`

Response:

```julia
Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."
At line:1 char:96
+ ... pe]::Tls12; (New-Object System.Net.Webclient).DownloadFile('https://r ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

```

If anyone has got a clue, let me know :-o.

---

<div class="post-metadata">

### Author: ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)
#### Post date: [September 25, 2019, 6:52am UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/5 "2019-09-25T06:52:24Z")

</div>

Try

```julia
]add Conda

>Conda.add("jupyterlab")

]add IJulia

```

Remove any other Anaconda/Miniconda installations first.

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [September 25, 2019, 11:00am UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/6 "2019-09-25T11:00:18Z")

</div>

I tried to add the `Conda` package first, but running it produced a similar error message as before.

Note: I didn’t remove the existing Anaconda installation prior to doing this. Is that necessary?

- Do you mean that I have to choose between having Python and Julia on my machine?
- Or do you mean that I first have to install Python/Anaconda in the Julia context, and next can use that version of Python by starting up that installation independently?

---

<div class="post-metadata">

### Author: ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)
#### Post date: [September 25, 2019, 11:25am UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/7 "2019-09-25T11:25:43Z")

</div>

[Conda.jl](https://github.com/JuliaPy/Conda.jl) will install Miniconda in `C:\Users\user_name\.julia\conda\3\`, when you first add a python library (`julia> Conda.add("jupyterlab")`), which will provide you with python and a terminal window too. So you don’t need to start with a separate Anaconda/Miniconda installation.

After `Conda.add("jupyterlab")` completes, check that running “jupyter lab” works from both the python terminal, and the windows cmd prompt. If the latter doesn’t work, make sure the directory jupyter is in, is in your path env (`c:\Users\user_name\.julia\conda\3\Scripts`).

Also, when you start the Julia terminal, do you right-click and “Run as administrator”?

---

<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: [September 25, 2019, 12:22pm UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/8 "2019-09-25T12:22:38Z")

</div>

> [@BLI](#):
>
> `An exception occurred during a WebClient request.`

Googling this error message seems to suggest that [the path does not exist](https://stackoverflow.com/questions/8033619/an-exception-occurred-during-a-webclient-request-while-using-c-sharp-asp-net).

I’m guessing that you manually deleted your `C:\Users\user_name\.julia\conda` directory — in this case you need to re-run

```julia
pkg> add Conda
pkg> build Conda

```

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [September 25, 2019, 2:25pm UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/9 "2019-09-25T14:25:03Z")

</div>

I did. OK – since I was out of office today, I decided to upgrade to Julia 1.2.0. So I removed everything Julia from my computer, and then re-installed everything (using `include(...)` to add packages). So now, I’m back in office, and Julia seems to work.

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [September 25, 2019, 3:10pm UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/10 "2019-09-25T15:10:45Z")

</div>

Ooops… `jupyterlab()` starts up the browser. The browser opens with past notebooks, and I’m asked to choose kernel. I choose `Julia 1.2.0`. Then I get a long error message…

```julia
Traceback (most recent call last):
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\tornado\web.py", line 1699, in _execute
    result = await result
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info) # type: ignore
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
    type=mtype))
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info) # type: ignore
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info) # type: ignore
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 101, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 209, in wrapper
    yielded = next(result)
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\jupyter_client\manager.py", line 259, in start_kernel
    **kw)
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\jupyter_client\manager.py", line 204, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "C:\Users\User_Name\.julia\conda\3\lib\site-packages\jupyter_client\launcher.py", line 138, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "C:\Users\User_Name\.julia\conda\3\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "C:\Users\User_Name\.julia\conda\3\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

```

If I pull down the Kernel menu and try to change kernel, I get the following message:

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

Any ideas?

---

<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: [September 25, 2019, 4:38pm UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/11 "2019-09-25T16:38:05Z")

</div>

If it can’t find the Julia kernel, that usually means that you changed the location of `Julia` since IJulia was built. Run `build IJulia` at the pkg prompt and it should fix it.

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [September 26, 2019, 9:07am UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/12 "2019-09-26T09:07:21Z")

</div>

I did `build IJulia` at the command prompt. Same problem as before.

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [September 26, 2019, 2:04pm UTC](https://discourse.julialang.org/t/ijulia-after-removing-python/29111/13 "2019-09-26T14:04:18Z")

</div>

OK – I made it work… I simply removed everything on my computer related to both Python and Julia. Then I installed Julia, and checked that IJulia worked. Next, I installed Anaconda, and checked that that worked. Finally, I rechecked that IJulia worked after installing Python from Anaconda.

Didn’t really cost that much time: my computer ran scripted `Pkg.add()`'s while I attended a PhD defence.
