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

Numpy error when loading package #5

Open
simonbyrne opened this issue Oct 20, 2021 · 2 comments
Open

Numpy error when loading package #5

simonbyrne opened this issue Oct 20, 2021 · 2 comments

Comments

@simonbyrne
Copy link

ERROR: LoadError: PyError (PyImport_ImportModule

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

PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package.  To install the vtk.util.numpy_support module, you can
use `pyimport_conda("vtk.util.numpy_support", PKG)`, where PKG is the Anaconda
package the contains the module vtk.util.numpy_support, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).

Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python.   As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.

) <class 'ModuleNotFoundError'>
ModuleNotFoundError("No module named 'vtkCommonCorePython'")
  File "/Users/simon/.julia/conda/3/lib/python3.7/site-packages/vtk.py", line 32, in <module>
    all_spec.loader.exec_module(all_m)
  File "/Users/simon/.julia/conda/3/lib/python3.7/site-packages/vtkmodules/all.py", line 7, in <module>
    from .vtkCommonCore import *
  File "/Users/simon/.julia/conda/3/lib/python3.7/site-packages/vtkmodules/vtkCommonCore.py", line 9, in <module>
    from vtkCommonCorePython import *
@slayoo
Copy link

slayoo commented Oct 20, 2021

Something perhaps similar is described here: https://marc.info/?l=vtkusers&m=142478433909254

It seems that the default vtk Python package installation assumes that instead of "python" command one will use "vtkpython". So, there is a chance that either pointing PyCall to vtkpython instead of python (PYCALL_JL_RUNTIME_PYTHONHOME and PYTHON env vars) or setting PYTHONPATH and LD_LIBRARY_PATH to include location of the vtkCommonCorePython.so file will help.

@mohamed82008
Copy link
Member

Somehow I missed this issue. You seem to be using Python 3.7. I will try to simplify the setup process using PythonCall.jl #6.

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

3 participants