Bug #3176
[vtk]: should depend on openvr
0%
Description
- Steps to reproduce:
- `# pacman -Sy vtk`
- Start Python (run this in a terminal: `$ python`)
- Inside the session, type `import vtk`
- Expected result:
Being able to use vtk inside of a Python session
- Actual result:
ImportError: libopenvr_api.so: cannot open shared object file: No such file or directory
- Suggestions and workaround:
To go around this, install openvr (`pacman -F libopenvr_api.so`): `# pacman -Sy openvr`.
I would suggest to add openvr as a runtime dependency (I still haven't created a building environment to do it myself, sorry).
- Software version
vtk 9.1.0-9
python 3.10.1
openvr 1.16.8-2
History
Updated by bill-auger about 2 years ago
'openvr' is an optional dependency (so is python) - that normally
suggests a package which is mostly useful without any optional
dependencies; but has some extra functionality when some/any
optional dependencies are present
if that describes the relationship between 'vtk' and 'openvr',
the depends/optdepends are probably correct now (understood
semantically, and expected by savvy users of an arch system)
that python error makes it appear that there is an intrinsic
dependency; but it may not be so, or it may be so only for
python programs
it appears that all related packages ('vtk', 'openvr', and
'python') come directly from arch; so the first thing to do
is to see if arch's python behaves the same, and/or if a
bug report exists already about it
Updated by bill-auger about 2 years ago
- Status changed from unconfirmed to info needed
- Subject changed from vtk should depend on openvr to [vtk]: should depend on openvr
Updated by bill-auger about 2 years ago
it looks like this is a known issue in arch https://bugs.archlinux.org/task/61655
that BR suggests, contrary to the normal general cases i described before, that 'vtk', especially when used via python, will fail if any libs are missing, which the vtk lib was compiled to support
this is what i get on arch:
$ python -c 'import vtk' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.10/site-packages/vtk.py", line 31, in <module> all_m = importlib.import_module('vtkmodules.all') File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/usr/lib/python3.10/site-packages/vtkmodules/all.py", line 8, in <module> from .vtkWebCore import * ImportError: libpugixml.so.1: cannot open shared object file: No such file or directory
this is what i get on parabola:
$ python -c 'import vtk' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.10/site-packages/vtk.py", line 31, in <module> all_m = importlib.import_module('vtkmodules.all') File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/usr/lib/python3.10/site-packages/vtkmodules/all.py", line 8, in <module> from .vtkWebCore import * ImportError: libfmt.so.8: cannot open shared object file: No such file or directory
the exact error depends on which of vtk's true dependencies are and are not installed -
i had 'pugixml' installed already - after installing 'fmt':
$ python -c 'import vtk' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.10/site-packages/vtk.py", line 31, in <module> all_m = importlib.import_module('vtkmodules.all') File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/usr/lib/python3.10/site-packages/vtkmodules/all.py", line 46, in <module> from .vtkRenderingRayTracing import * ImportError: libospray.so.2: cannot open shared object file: No such file or directory
'openvr', 'ospray', and 'pugixml' are all in optdepends - 'fmt' is not - ive a feeling this is a deep rabbit-hole
Updated by nona about 2 years ago
Plop! (comical fall).
Should we then mark this as "forwarded upstream" or "confirmed"?
Updated by bill-auger about 2 years ago
- Status changed from info needed to forwarded upstream
yes, it looks like the typical case for 'forwarded-upstream' status - generally, if the problem exists in arch, the problem must be fixed in arch, and there should be a BR on the arch bug tracker - if not, i would add one, reference it on the parabola BR, and set the status to 'forwarded-upstream' - likewise if the same problem is already described in an open BR on the arch bug tracker, save one step
Updated by bill-auger about 2 years ago
as an update, the arch packager believes that since v9 of vtk, it is recommended for any script not to import the entire 'vtk' module - seems like a poor design to me (why not simply make them separate modules, and avoid the confusion with a technical solution); but my mind is admittedly not very "pythonical"
Updated by nona 26 days ago
Hi. I think I got a reincarnation of this with a package from the AUR that tries to use VTK (without importing the full vtk):
import pyvista
File "/usr/lib/python3.11/site-packages/pyvista/__init__.py", line 9, in <module> from pyvista.core import * File "/usr/lib/python3.11/site-packages/pyvista/core/__init__.py", line 4, in <module> from . import _vtk_core File "/usr/lib/python3.11/site-packages/pyvista/core/_vtk_core.py", line 249, in <module> from vtkmodules.vtkFiltersExtraction import ( ImportError: libfmt.so.10: cannot open shared object file: No such file or directory
# pacman -S --asdep fmt
import pyvista
Traceback (most recent call last): File "<string>", line 17, in __PYTHON_EL_eval File "/home/edgar/GlassFibre/Code/examples/dolfinx_cyclic_softening.py", line 29, in <module> import pyvista as pv File "/usr/lib/python3.11/site-packages/pyvista/__init__.py", line 9, in <module> from pyvista.core import * File "/usr/lib/python3.11/site-packages/pyvista/core/__init__.py", line 4, in <module> from . import _vtk_core File "/usr/lib/python3.11/site-packages/pyvista/core/_vtk_core.py", line 249, in <module> from vtkmodules.vtkFiltersExtraction import ( ImportError: libverdict.so.1.4: cannot open shared object file: No such file or directory
# pacman -S --asdep verdict
import pyvista
(success)
>>> import pyvista >>>
I will try to report it as a bug upstream