JuliaPy / JuliaPy/PyCall.jl

pyimport("pyvista") problem

Abierto
#920 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Julia
Estrellas
1.5k
Forks
186
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## Description

I encounter a problem that when calling PyVista through PyCall by `using PyCall; pv = pyimport("pyvista")`, whereas there is no problem when directly use pyvista in python. I do use the same conda env for both python and Julia (/lustre/home/.julia/adcme/bin/python). I have tested setting ENV["PYTHON"] or `Conda.add` way or
`pip install pyvista==0.30.0rc1` or `conda install -c conda-forge pyvista` or `conda install -c conda-forge xvfbwrapper`, then rebuilding PyCall and restarting Julia etc., but the problem remains.

The errors are as below.

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

PyCall is currently configured to use the Python version at:

/lustre/home/.julia/adcme/bin/python

and you should use whatever mechanism you usually use (apt-get, pip, conda,
etcetera) to install the Python package containing the pyvista 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 pyvista module, you can use `pyimport_conda("pyvista", PKG)`,
where PKG is the Anaconda package that contains the module pyvista,
or alternatively you can use the Conda package directly (via
`using Conda` followed by `Conda.add` etcetera).

)
ImportError('libX11.so.6: cannot open shared object file: No such file or directory')
File "/lustre/home/.julia/adcme/lib/python3.7/site-packages/pyvista/__init__.py", line 11, in
from pyvista.plotting import *
File "/lustre/home/.julia/adcme/lib/python3.7/site-packages/pyvista/plotting/__init__.py", line 7, in
from .helpers import plot, plot_arrows, plot_compare_four, plot_itk
File "/lustre/home/.julia/adcme/lib/python3.7/site-packages/pyvista/plotting/helpers.py", line 7, in
from pyvista.utilities import is_pyvista_dataset
File "/lustre/home/.julia/adcme/lib/python3.7/site-packages/pyvista/utilities/__init__.py", line 2, in
from .errors import (GPUInfo, Observer, Report,
File "/lustre/home/.julia/adcme/lib/python3.7/site-packages/pyvista/utilities/errors.py", line 12, in
from pyvista import _vtk
File "/lustre/home/.julia/adcme/lib/python3.7/site-packages/pyvista/_vtk.py", line 41, in
from vtkmodules.vtkRenderingVolumeOpenGL2 import (vtkOpenGLGPUVolumeRayCastMapper,

Stacktrace:
[1] pyimport(name::String)
@ PyCall /lustre/home/.julia/packages/PyCall/BD546/src/PyCall.jl:550
[2] top-level scope
@ REPL[5]:1
```

I use Julia through `singularity exec julia_latest.sif julia`. I am working on an HPC cluster without `sudo` privilege.

Thanks.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start at the pyimport entry point shown in PyCall/src/PyCall.jl:550 and reproduce `using PyCall; pyimport("pyvista")` with the reported Python environment. Examine the reported `libX11.so.6` ImportError and the Singularity/HPC setup; done would mean identifying a supported configuration or a concrete PyCall change that allows the import to succeed.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
tooling
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.