Hello Julia/PyCall team,
trying to add the PyCall package I get the error
build.log` [> ] 0/2
ERROR: Error building `PyCall`:
┌ Info: No system-wide Python was found; got the following error:
│ Base.IOError("could not spawn setenv(`'C:\\ProgramData\\Anaconda3' -c \"import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSIO
N'))\"`,[\"PATH=C:\\\\Windows\\\\system32;C:\\\\Windows;C:\\\\Windows\\\\System32\\\\Wbem;C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\;C
....
.... "]): no such file or directory (ENOENT)", -4058)
└ using the Python distribution in the Conda package
[ Info: Running `conda install -y numpy` in root environment
ERROR: LoadError: failed process: Process(setenv(`'C:\Users\Giovanni Pietrobon\.julia\conda\3\Scripts\conda.exe' install -y numpy`,["PATH=C:\\Users\\Giovanni Pietrobon\\.julia\\conda\\3\\Library\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShe
.....
"]), ProcessExited(3221225595)) [3221225595]
Stacktrace:
[1] pipeline_error
@ .\process.jl:525 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base .\process.jl:440
[3] run
@ .\process.jl:438 [inlined]
[4] runconda(args::Cmd, env::String)
@ Conda C:\Users\Giovanni Pietrobon\.julia\packages\Conda\sNGum\src\Conda.jl:129
[5] add(pkg::String, env::String; channel::String)
@ Conda C:\Users\Giovanni Pietrobon\.julia\packages\Conda\sNGum\src\Conda.jl:221
[6] add (repeats 2 times)
@ C:\Users\Giovanni Pietrobon\.julia\packages\Conda\sNGum\src\Conda.jl:220 [inlined]
[7] top-level scope
@ C:\Users\Giovanni Pietrobon\.julia\packages\PyCall\3fwVL\deps\build.jl:79
[8] include(fname::String)
@ Base.MainInclude .\client.jl:444
[9] top-level scope
@ none:5
using Windows 7
64-bit
Julia 1.6.3
Anaconda3-2021.05-Windows-x86_64
antivirus disabled
rebooted quite a few times
Despite having tried (and read) all I could find, I’m still stuck.
I reinstalled everything from scratch. Even as administrator.
Installed Anaconda for all users (it seems things are going better)
I tried to go on python and update numpy, here’s the log
(base) C:\Users\Giovanni Pietrobon>conda update -y numpy
Collecting package metadata (current_repodata.json): done
Solving environment: \
Updating numpy is constricted by
anaconda -> requires numpy==1.20.1=py38h34a8a5c_0
If you are sure you want an update of your package either try `conda update --all` or install a specific version of the package you want using `conda
install <pkg>=<version>`
done
# All requested packages already installed.
Similarly I tried conda update --all
from conda
It fails too.
Realizing that numpy is actually successfully installed on conda, I also tried to have PyCall to use that version and did set on Windows
set PYTHON = "C:\ProgramData\Anaconda3"
As they say somewhere I have to set it from Julia too:
ENV["PYTHON"] = raw"C:\ProgramData\Anaconda3"
I did it. (I wonder if it really make a difference…),
but still the error and the log is the same.
Why doesn’t find Python in first place??
Conda is installed in a directory without spaces, it should be found there,
I noticed that Julia then tries to install Miniconda, which happens to be in the .julia directory which is one with a space because of the username I use. I hope that is not the problem.
I also tried to add Matplotlib first, as described in
V1.4 failed to precompile PyCall and PyPlot on windows 7 x64
I did it successfully, but still PyCall build fails.
I didn’t try what suggested by temporaryred in
PyCall failing to build, cannot figure out solution. _ Julia
Should I try alternatives like suggested by @stevengj in
Dreaded PyCall build error ?
I’m not affectionate to anaconda at all, but I definitely need to use python too with data science.
Thank you for any help in advance.