PyPlot problems when building with Julia

471 Views Asked by At

I am having problems building PyCall in Julia (I am using a Mac). I have the message:

julia> Pkg.build("PyCall") Building Conda ─→ ~/.julia/packages/Conda/3rPhK/deps/build.log

Building PyCall → ~/.julia/packages/PyCall/BcTLp/deps/build.log

┌ Error: Error building `PyCall`: 
│   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
│                                  Dload  Upload   Total   Spent    Left  Speed
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 55.2M  100 55.2M    0     0  8088k      0  0:00:06  0:00:06 --:--:--  9.8M
│ ERROR: did not recognize option '1/.julia/conda/3', please try -h
│ ┌ 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 ...
│ ERROR: LoadError: failed process: Process(`'/Users/ymedinag 1/.julia/conda/3/installer.sh' -b -f -p '/Users/ymedinag 1/.julia/conda/3'`, ProcessExited(1)) [1]
│ Stacktrace:
│  [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
│  [2] pipeline_error at ./process.jl:705 [inlined]
│  [3] #run#505(::Bool, ::Function, ::Cmd) at ./process.jl:663
│  [4] run at ./process.jl:661 [inlined]
│  [5] _install_conda(::String, ::Bool) at /Users/ymedinag 1/.julia/packages/Conda/3rPhK/src/Conda.jl:169
│  [6] _install_conda(::String) at /Users/ymedinag 1/.julia/packages/Conda/3rPhK/src/Conda.jl:155
│  [7] runconda(::Cmd, ::String) at /Users/ymedinag 1/.julia/packages/Conda/3rPhK/src/Conda.jl:112
│  [8] #add#1(::String, ::Function, ::String, ::String) at /Users/ymedinag 1/.julia/packages/Conda/3rPhK/src/Conda.jl:188
│  [9] add at /Users/ymedinag 1/.julia/packages/Conda/3rPhK/src/Conda.jl:187 [inlined] (repeats 2 times)
│  [10] top-level scope at /Users/ymedinag 1/.julia/packages/PyCall/BcTLp/deps/build.jl:84
│  [11] include at ./boot.jl:317 [inlined]
│  [12] include_relative(::Module, ::String) at ./loading.jl:1044
│  [13] include(::Module, ::String) at ./sysimg.jl:29
│  [14] include(::String) at ./client.jl:392
│  [15] top-level scope at none:0
│ in expression starting at /Users/ymedinag 1/.julia/packages/PyCall/BcTLp/deps/build.jl:43
└ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1096

Would you have any idea to have PyCall properly installed ?

Thank you

1

There are 1 best solutions below

1
On BEST ANSWER

The problem comes from the fact that there's a space in your username, or more specifically your user directory /Users/ymedinag 1/. Unfortunately, it seems to be a known and unresolved problem with Anaconda installers. Here, PyCall by default tries to use a miniconda Python, via Conda.jl, which in turn tries to install it via miniconda's installer.sh script. The problem comes from that script apparently being unable to deal with spaces in the installation directory.

Instead of using the default Julia-managed conda-Python (which is failing to install), you can instead install miniconda yourself to a directory without spaces, and then set ENV["PYTHON"] = <your-miniconda-python-path> before running Pkg.build("PyCall") again.