Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] julia.tools.PyCallInstallError: Precompiling PyCall failed. #140

Closed
juanmvenegas opened this issue May 18, 2022 · 6 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@juanmvenegas
Copy link

Describe the bug
When running pysr.install(), installation fails when PyCall compilation starts.

Version (please complete the following information):

  • OS: Windows 10
  • Version 0.8.4 (installed via pip)

Configuration
Currently trying to install with julia v1.7.2, whioch was installed immediately before installing pysr.
Cannot move past installation step

Error message

[ Info: Julia executable: C:\Users\UA34141\AppData\Local\Programs\Julia-1.7.2\bin\julia.exe
[ Info: Trying to import PyCall...
┌ Error: `import PyCall` failedexception =InitError: could not load symbol "Py_CompileString":
│    The specified procedure could not be found.
│    Stacktrace:
│        @ C:\Users\UA34141\.julia\packages\PyCall\7a7w0\src\exception.jl:95 [inlined]
│      [2] pyeval_(s::String, globals::PyCall.PyDict{String, PyCall.PyObject, true}, locals::PyCall.PyDict{String, PyCall.PyObject, true}, input_type::Int64, fname::String) (repeats 2 times)
│        @ PyCall C:\Users\UA34141\.julia\packages\PyCall\7a7w0\src\pyeval.jl:34
│        @ PyCall C:\Users\UA34141\.julia\packages\PyCall\7a7w0\src\pyinit.jl:235
│      [4] _include_from_serialized(path::String, depmods::Vector{Any})
│        @ Base .\loading.jl:768
│      [5] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
│        @ Base .\loading.jl:854
│      [6] _require(pkg::Base.PkgId)
│        @ Base .\loading.jl:1097
│      [7] require(uuidkey::Base.PkgId)
│        @ Base .\loading.jl:1013
│      [8] top-level scope
│        @ C:\Users\UA34141\Miniconda3\envs\datasci\Lib\site-packages\julia\install.jl:36
│      [9] include(mod::Module, _path::String)
│        @ Base .\Base.jl:418
│     [10] exec_options(opts::Base.JLOptions)
│        @ Base .\client.jl:292
│     [11] _start()
│        @ Base .\client.jl:495during initialization of module PyCall
└ @ Main C:\Users\UA34141\Miniconda3\envs\datasci\Lib\site-packages\julia\install.jl:38Info: PyCall is already installed but importing it failed.
└ Re-building PyCall may fix the issue...
[ Info: Run `Pkg.build("PyCall"; verbose=true)`
  Installing known registries into `C:\Users\UA34141\.julia`
    Building Conda ─→ `C:\Users\UA34141\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\6e47d11ea2776bc5627421d59cdcc1296c058071\build.log`Info: CONDA_EXE not found. Reverting to default in ROOTENVCONDA_EXE = "C:\\Users\\UA34141\\.julia\\conda\\3\\Scripts\\conda.exe"ROOTENV = "C:\\Users\\UA34141\\.julia\\conda\\3"
    Building PyCall`C:\Users\UA34141\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\1fc929f47d7c151c839c5fc1375929766fb8edcc\build.log`
[ Info: PyCall is using C:\Users\UA34141\Miniconda3\envs\datasci\python.exe (Python 3.8.0) at C:\Users\UA34141\Miniconda3\envs\datasci\python.exe, libpython = C:\Users\UA34141\Miniconda3\envs\datasci\python38.dll
[ Info: C:\Users\UA34141\.julia\packages\PyCall\7a7w0\deps\deps.jl has not changed
[ Info: C:\Users\UA34141\.julia\prefs\PyCall has not changed
[ Info: `C:\Users\UA34141\.julia\packages\PyCall\7a7w0\src\..\deps\deps.jl`
const python = "C:\\Users\\UA34141\\Miniconda3\\envs\\datasci\\python.exe"
const libpython = "C:\\Users\\UA34141\\Miniconda3\\envs\\datasci\\python38.dll"
const pyprogramname = "C:\\Users\\UA34141\\Miniconda3\\envs\\datasci\\python.exe"
const pyversion_build = v"3.8.0"
const PYTHONHOME = "C:\\Users\\UA34141\\Miniconda3\\envs\\datasci"

"True if we are using the Python distribution in the Conda package."
const conda = false
ERROR: InitError: could not load symbol "Py_CompileString":
The specified procedure could not be found.
Stacktrace:
 [1] macro expansion
   @ C:\Users\UA34141\.julia\packages\PyCall\7a7w0\src\exception.jl:95 [inlined]
 [2] pyeval_(s::String, globals::PyCall.PyDict{String, PyCall.PyObject, true}, locals::PyCall.PyDict{String, PyCall.PyObject, true}, input_type::Int64, fname::String) (repeats 2 times)
   @ PyCall C:\Users\UA34141\.julia\packages\PyCall\7a7w0\src\pyeval.jl:34
 [3] __init__()
   @ PyCall C:\Users\UA34141\.julia\packages\PyCall\7a7w0\src\pyinit.jl:235
 [4] _include_from_serialized(path::String, depmods::Vector{Any})
   @ Base .\loading.jl:768
 [5] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
   @ Base .\loading.jl:854
 [6] _require(pkg::Base.PkgId)
   @ Base .\loading.jl:1097
 [7] require(uuidkey::Base.PkgId)
   @ Base .\loading.jl:1013
 [8] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:997
during initialization of module PyCall

Additional context
I have tried to install pysr from conda in existing and new environments and have always run into issues, which is why I had to use pip.

Thanks for any help!

@juanmvenegas juanmvenegas added the bug Something isn't working label May 18, 2022
@MilesCranmer
Copy link
Owner

If you are using the conda version, can you try to downgrade to Julia 1.7.1 instead? As far as I know the conda version of Julia 1.7.2 has some issues–this is why pysr on conda will install 1.7.1 by default.

@MilesCranmer
Copy link
Owner

Wait, how are you installing julia with conda on Windows? As far as I know, there isn't actually a julia package set up on conda for windows. Only macOS and Linux have conda set up for julia: https://github.com/conda-forge/julia-feedstock.

On Windows, you should install julia manually, and then install pysr through pip, rather than conda. (I should mention this on the README actually...)

@juanmvenegas
Copy link
Author

juanmvenegas commented May 18, 2022

Sorry for not clarifying. I installed julia through the windows binaries: https://julialang.org/downloads/

I added julia to my PATH and then opened my conda env and installed pysr via pip. I can try to downgrade julia in case that may make a difference.

@MilesCranmer
Copy link
Owner

Hm, I am not sure. This shows up in your pasted error which might be a clue:

CONDA_EXE = "C:\\Users\\UA34141\\.julia\\conda\\3\\Scripts\\conda.exe"

did you try to install julia through conda initially?

I might try re-doing this in a fresh conda environment, with a fresh julia install (i.e., delete ~/.julia)–maybe the error will go away. I don't have good intuition for this error however.

You should also try to ask on the PyJulia github since this isn't actually a PySR error but a PyJulia one. pysr.install() just runs the PyJulia install procedure.

@juanmvenegas
Copy link
Author

Thank you for your suggestions!

I deleted ~/.julia and started in a fresh environment and was able to succesfully run pysr.install().

@MilesCranmer
Copy link
Owner

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants