How to build mayavi with a manually installed VTK?
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 316
- Avg merge
- 7h 44m
- Merged PRs (30d)
- 5
Description
**Type:** Question
**OS:** Ubuntu 16.04
**Question:** How to configure mayavi's `setup.py` so that it recognizes the manually installed `VTK` (shared) library?
---
I would like to build `mayavi` with the manually installed `VTK 8.2.0`, which is built with Python3 wrapper and installed in `/opt/vtk-8.2.0/` folder.
The VTK Python modules and wrappers reside in `~/.conda/envs/py36/lib/python3.6/site-packages/` (I created symlink to point to the files in `/opt/` folder). And in this virtual environment, I can import `vtk` *without any error*.
Now when I tried to build `mayavi` [from source](https://docs.enthought.com/mayavi/mayavi/installation.html#bleeding-edge) by running:
```bash
python setup.py install
```
it seems that it couldn't detect the existing `vtk` and apparently it overwrites the existing one:
```bash
...
Processing dependencies for mayavi==4.7.1
Searching for vtk
Reading https://pypi.org/simple/vtk/
Downloading https://files.pythonhosted.org/packages/22/f5/30e11e1ad21701e1cd185b046979107930419a74a5602c6b899dc8523fe4/vtk-8.1.2-cp36-cp36m-manylinux1_x86_64.whl#sha256=34b43d32609d81d94a7122e388f7d6a0883138438484d0ee29158726810f6704
Best match: vtk 8.1.2
Processing vtk-8.1.2-cp36-cp36m-manylinux1_x86_64.whl
Installing vtk-8.1.2-cp36-cp36m-manylinux1_x86_64.whl to ~/.conda/envs/py36/lib/python3.6/site-packages
Adding vtk 8.1.2 to easy-install.pth file
...
```
I'm not very sure if having two different versions of the same package will be safe, so I removed the newly installed `vtk-8.1.2`. And by doing so, `mayavi` cannot run:
```bash
File "~/.conda/envs/py36/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/mayavi/mlab.py", line 16, in
from mayavi.tools.camera import view, roll, yaw, pitch, move
File "~/.conda/envs/py36/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/mayavi/tools/camera.py", line 24, in
from .engine_manager import get_engine
File "~/.conda/envs/py36/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/mayavi/tools/engine_manager.py", line 14, in
from mayavi.core.engine import Engine
File "~/.conda/envs/py36/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/mayavi/core/engine.py", line 34, in
from mayavi.core.ui.mayavi_scene import viewer_factory
File "~/.conda/envs/py36/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/mayavi/core/ui/mayavi_scene.py", line 12, in
from tvtk.tools.ivtk import IVTK
File "~/.conda/envs/py36/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/tvtk/tools/ivtk.py", line 35, in
from tvtk.pyface.api import Scene, DecoratedScene
File "~/.conda/envs/py36/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/tvtk/pyface/api.py", line 1, in
from .decorated_scene import DecoratedScene
File "~/.conda/envs/py36/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/tvtk/pyface/decorated_scene.py", line 12, in
from tvtk.pyface.toolkit import toolkit_object
File "~/.conda/envs/py36/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/tvtk/pyface/toolkit.py", line 3, in
toolkit = toolkit_object = find_toolkit('tvtk.toolkits')
File "~/.conda/envs/py36/lib/python3.6/site-packages/pyface/base_toolkit.py", line 263, in find_toolkit
return import_toolkit(ETSConfig.toolkit, entry_point)
File "~/.conda/envs/py36/lib/python3.6/site-packages/pyface/base_toolkit.py", line 217, in import_toolkit
toolkit_object = plugin.load()
File "~/.conda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2442, in load
self.require(*args, **kwargs)
File "~/.conda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2465, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "~/.conda/envs/py36/lib/python3.6/site-packages/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'vtk' distribution was not found and is required by the application
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.