Conda.jl icon indicating copy to clipboard operation
Conda.jl copied to clipboard

Endless miniconda install loop

Open pemryan opened this issue 7 years ago • 11 comments

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.

pemryan avatar Jul 10 '17 04:07 pemryan

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

davidzentlermunro avatar Jul 31 '17 14:07 davidzentlermunro

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.

mbeltagy avatar Feb 22 '18 10:02 mbeltagy

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.

stevengj avatar Feb 22 '18 16:02 stevengj

so,who knows how to solve such problem?

ayan1991 avatar May 15 '18 06:05 ayan1991

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

stevengj avatar Jun 13 '18 19:06 stevengj

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 ...

epogrebnyak avatar Jun 23 '18 16:06 epogrebnyak

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.

pedrolazera avatar Feb 17 '20 02:02 pedrolazera

I just installed on Windows 10 with no problem, so it would be nice to know what is causing the failure on some machines.

stevengj avatar Feb 17 '20 19:02 stevengj

I STILL have problem! Anybody please help me out!

AJV009 avatar Mar 29 '20 10:03 AJV009

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 tried but I still get false from isfile(Conda.conda)

AJV009 avatar Mar 29 '20 13:03 AJV009

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

AJV009 avatar Mar 29 '20 21:03 AJV009