Conda.jl
Conda.jl copied to clipboard
Endless miniconda install loop
move from here: https://github.com/JuliaPy/PyCall.jl/issues/379
seems something wired happens in C:\JuliaPro-0.5.2.2\pkgs-0.5.2.2\v0.5\Conda\src\conda.jl, around line 186:
if is_windows()
if VERSION >= v"0.5.0-dev+8873" # Julia PR #13780
run(Cmd($installer /S /AddToPath=0 /RegisterPython=0 /D=$PREFIX, windows_verbatim=true))
else
# Workaround a bug in command-line argument parsing, see
# Luthaf/Conda.jl#17
if match(r" {2,}", "") != nothing
error("The installer will fail when the path="$PREFIX" contains two consecutive spaces")
end
run($installer /S /AddToPath=0 /RegisterPython=0 $(split("/D=$PREFIX")))
end
end
I checked the install.exe downloaded, it can be installed manually. C:\JuliaPro-0.5.2.2\pkgs-0.5.2.2\v0.5\Conda\deps\usr>installer.exe /AddToPath=0 /RegisterPython=0 /D="C:\JuliaPro-0.5.2.2\pkgs-0.5.2.2\v0.5\Conda\deps\usr".
Then re-run Pkg.build("PyCall"), the miniconda download-install loop can be bypassed.
I'm also having this issue. First when I try using PyPlot I get the error: No working GUI backend found for matplotlib
. I then try standard solution for this - ENV["PYTHON"]=""; Pkg.build("PyCall")
. However, this starts an endless chain of julia downloading and installing miniconda:
INFO: Downloading miniconda installer ... INFO: Installing miniconda ... INFO: Downloading miniconda installer ... INFO: Installing miniconda ... INFO: Downloading miniconda installer ... INFO: Installing miniconda ... INFO: Downloading miniconda installer ... INFO: Installing miniconda ...
I am using julia 0.5.0 via Juno for JuliaPro0.50.5
This problem is still outstanding. I saw this on friend's computer running Windows 10. We downloaded Julia 0.62 and proceeded to install IJulia when we came across this problem. It is blocker for a novice and we are thinking now that the only alternative in to install on the Linux subsystem of windows.
Presumably it is some network or firewall problem with your machine?
The simplest alternative would be to download Matplotlib yourself, e.g. by installing Anaconda Python manually.
so,who knows how to solve such problem?
Any updates here? ~~It seems like a problem in the Miniconda installer script for Windows, not something we can fix ourselves?~~ May be due to deficiencies of Base.download
, see https://github.com/JuliaLang/julia/issues/27043
It is still a problem on Windows 10:
INFO: Building Conda
INFO: Building PyCall
Info: Using the Python distribution in the Conda package by default.
To use a different Python version, set ENV["PYTHON"]="pythoncommand" and re-run Pkg.build("PyCall").
Info: Downloading miniconda installer ...
Info: Installing miniconda ...
Info: Downloading miniconda installer ...
Info: Installing miniconda ...
Info: Downloading miniconda installer ...
Info: Installing miniconda ...
Info: Downloading miniconda installer ...
Info: Installing miniconda ...
Info: Downloading miniconda installer ...
Info: Installing miniconda ...
Info: Downloading miniconda installer ...
Info: Installing miniconda ...
Info: Downloading miniconda installer ...
Info: Installing miniconda ...
I think I found a way to solve the issue. The workaround is use a pre-existing Conda installation, to prevent the Conda Julia module to try to install a new Conda ("Installing miniconda..."). I'm using Windows 10.
In the end, you have to make sure that, in Julia, after you load the Conda.jl module ("using Conda"), the command isfile(Conda.conda)
returns true
1. Install conda or miniconda on your computer. Here are the official docs: https://docs.conda.io/projects/conda/en/latest/user-guide/install/
2. Open the Anaconda Prompt and create a new environment with the following command:
conda create --name conda_jl python conda
The "conda" at the end will make sure the Conda.exe file exists in this new environment.
3. In Julia, run the following commands:
julia> ENV["CONDA_JL_HOME"] = "/path/to/miniconda/envs/conda_jl"
pkg> build Conda
Another way is to add to your startup.jl file the following command:
ENV["CONDA_JL_HOME"] = "/path/to/miniconda/envs/conda_jl"
- obs: to view a list of all your existing conda environments, on a Anaconda Prompt type
conda env list
4. Close and open Julia. Check if the following commands work:
using Conda
Conda.add("numpy")
Done.
I just installed on Windows 10 with no problem, so it would be nice to know what is causing the failure on some machines.
I STILL have problem! Anybody please help me out!
I think I found a way to solve the issue. The workaround is use a pre-existing Conda installation, to prevent the Conda Julia module to try to install a new Conda ("Installing miniconda..."). I'm using Windows 10.
In the end, you have to make sure that, in Julia, after you load the Conda.jl module ("using Conda"), the command
isfile(Conda.conda)
returns true1. Install conda or miniconda on your computer. Here are the official docs: https://docs.conda.io/projects/conda/en/latest/user-guide/install/
2. Open the Anaconda Prompt and create a new environment with the following command:
conda create --name conda_jl python conda
The "conda" at the end will make sure the Conda.exe file exists in this new environment.
3. In Julia, run the following commands:
julia> ENV["CONDA_JL_HOME"] = "/path/to/miniconda/envs/conda_jl" pkg> build Conda
Another way is to add to your startup.jl file the following command:
ENV["CONDA_JL_HOME"] = "/path/to/miniconda/envs/conda_jl"
* obs: to view a list of all your existing conda environments, on a Anaconda Prompt type `conda env list`
4. Close and open Julia. Check if the following commands work:
using Conda Conda.add("numpy")
Done.
I tried but I still get false from isfile(Conda.conda)
Just ran the same commands this time with admin rights! And it worked
julia> run(`conda create -n conda_jl python conda`)
julia> ENV["CONDA_JL_HOME"] = "\\path\\to\\miniconda\\envs\\conda_jl" # change this to your path
pkg> build Conda