Pipeline_error when installing miniconda through Julia in order to run Jupyter notebook

87 Views Asked by At

In order to use Jupyter notebook in Julia, one can install it through Julia. The steps to get Jupyter up and running are:

julia> ]
pkg> add IJulia
julia> using IJulia
julia> notebook()

However, that could give a pipeline_error:

julia> notebook()
install Jupyter via Conda, y/n? [y]: y
[ Info: Downloading miniconda installer ...
[ Info: Installing miniconda ...
ERROR: failed process: Process(`'C:\Users\...\AppData\Local\Temp\installer.exe' /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 '/D=D:\...\Julia\packages\conda\3\x86_64'`, ProcessExited(2)) [2]

Stacktrace:
 [1] pipeline_error
   @ .\process.jl:565 [inlined]
 [2] run(::Cmd; wait::Bool)
   @ Base .\process.jl:480
 [3] run
   @ .\process.jl:477 [inlined]
 [4] _install_conda(env::String, force::Bool)  
   @ Conda D:\...\Julia\packages\packages\Conda\2lg2O\src\Conda.jl:228
 [5] _install_conda(env::String)
   @ Conda D:\...\Julia\packages\packages\Conda\2lg2O\src\Conda.jl:191
 [6] top-level scope
   @ REPL[28]:1
2

There are 2 best solutions below

0
Jens Wagemaker On

The problem is that miniforge (or possibly miniconda) does not allow an installation directory with more than 46 characters ("The installation path should be shorter than 46 characters".)

So the solution is to place the Julia depot in a sufficiently short path, for instance "D:\programs\JLpkg". To specify the Julia depot path, you need set the environment variable: JULIA_DEPOT_PATH.

0
krise On

I had the same issue on Windows 11, but I unfortuantely could not resolve it by setting the JULIA_DEPOT_PATH. Some undefined firewall issue could also be at play according to an IJulia Github issue, but I could not identify any specifics on that front either.

Instead, I manually installed Miniconda to the folder where IJulia expects it. In particular, I downloaded Miniconda from here and set the installation path to "C:\Users\...\.julia\conda\3\x86_64" (where ... refers to the user name).

IJulia and Conda could then successfully locate the environment:

julia> using IJulia
julia> notebook()
install Jupyter via Conda, y/n? [y]: y
[ Info: Running `conda install -y jupyter` in root environment
Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: done