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

Is pyrevolve new dependency of JUDI? #205

Closed
kerim371 opened this issue Sep 28, 2023 · 6 comments
Closed

Is pyrevolve new dependency of JUDI? #205

kerim371 opened this issue Sep 28, 2023 · 6 comments

Comments

@kerim371
Copy link
Contributor

Hi,

I recently installed JUDI 3.3.8 and when importing it I get error:

using JUDI
ERROR: InitError: PyError (PyImport_ImportModule

The Python package interface could not be imported by pyimport. Usually this means
that you did not install interface in the Python version being used by PyCall.

PyCall is currently configured to use the Python version at:

/home/kerim/python/python-3.9/bin/python

and you should use whatever mechanism you usually use (apt-get, pip, conda,
etcetera) to install the Python package containing the interface module.

One alternative is to re-configure PyCall to use a different Python
version on your system: set ENV["PYTHON"] to the path/name of the python
executable you want to use, run Pkg.build("PyCall"), and re-launch Julia.

Another alternative is to configure PyCall to use a Julia-specific Python
distribution via the Conda.jl package (which installs a private Anaconda
Python distribution), which has the advantage that packages can be installed
and kept up-to-date via Julia.  As explained in the PyCall documentation,
set ENV["PYTHON"]="", run Pkg.build("PyCall"), and re-launch Julia. Then,
To install the interface module, you can use `pyimport_conda("interface", PKG)`,
where PKG is the Anaconda package that contains the module interface,
or alternatively you can use the Conda package directly (via
`using Conda` followed by `Conda.add` etcetera).

) <class 'ModuleNotFoundError'>
ModuleNotFoundError("No module named 'pyrevolve'")
  File "/home/kerim/.julia/packages/JUDI/JEsVr/src/pysource/interface.py", line 5, in <module>
    from pyrevolve import Revolver

Stacktrace:
 [1] pyimport(name::String)
   @ PyCall ~/.julia/packages/PyCall/ilqDX/src/PyCall.jl:558
 [2] __init__()
   @ JUDI ~/.julia/packages/JUDI/JEsVr/src/JUDI.jl:170
 [3] _include_from_serialized(path::String, depmods::Vector{Any})
   @ Base ./loading.jl:696
 [4] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
   @ Base ./loading.jl:782
 [5] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1020
 [6] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:936
 [7] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:923
during initialization of module JUDI

is pyrevolve new dependency of JUDI?
Before that to use JUDI it used to be enough to install devito.
Am I right I should also preinstall pyrevolve?

@mloubout
Copy link
Member

pyrevolve is a dependency of devito that is now optional. JUDI however stills installs it, but it might not be installed if you install devito yourself instead of letting JUDI install it.

See Here That JUDI 3.3.8 does install it as an extra dependency

@kerim371
Copy link
Contributor Author

Oh, thank you! didn't know that JUDI preinstalls devito.

@mloubout
Copy link
Member

JUDI only preinstalls it if it doesn't find it, so if you install it yourself JUDI assumes it's installed with all needed dependencies.

@kerim371
Copy link
Contributor Author

I think for me the best solution is when I manually build PyCall using my python and then I install JUDI and JUDI handles its dependencies (like devito) by itself.

Am I right that this workflow may be written in such way (in julia repl) ? :

ENV["PYTHON"]="/path/to/my/python"

using Pkg
Pkg.add("PyCall")
Pkg.build("PyCall")
Pkg.add("JUDI")

@mloubout
Copy link
Member

Yes. You might need Pkg.build("JUDI") as well after the add

@kerim371
Copy link
Contributor Author

Ok, good to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants