Closed christianbrodbeck closed 7 years ago
I don't think Mayavi is on conda-forge yet so I don't think the one in defaults could work with this version of VTK.
The reason I assumed it was a general vtk
problem is that the error happens during a bare import vtk
statement. Could this be due to mayavi?
Mayavi on defaults does misspecify its vtk
dependency and I've opened an issue for that (https://github.com/ContinuumIO/anaconda-issues/issues/1365)
However the output before the exception contains the following lines, suggesting that mayavi is coming from conda-forge
(I think it was added very recently though):
The following packages will be downloaded:
...
mayavi-4.5.0 | np111py27_1 12.8 MB conda-forge
...
The Mayavi conda-forge recipe (https://github.com/conda-forge/mayavi-feedstock) explicitly requires vtk ==7.1.0
(https://github.com/conda-forge/mayavi-feedstock/blob/master/recipe/meta.yaml#L31)
You are right.
I'm confused though; the mayavi-feedstock CI is passing on all platforms: https://github.com/conda-forge/mayavi-feedstock/pull/2
You'd think this error would occur there as well, hm?
Might the relevant difference be that PySurfer imports mlab
from mayavi, which I don't think the mayavi feedstock test does? Unfortunately I don't have access to Linux to test this with vtk 7.
Actually, I think VTK is being built with vtkRenderingOpenGL2 instead of 1, and Mayavi isn't compatible with that.
[Edit] No, scratch that... -DVTK_RENDERING_BACKEND=OpenGL
requires vtk ==7.1.0
There is a discussion about that: https://github.com/conda-forge/mayavi-feedstock/issues/1
mayavi-feedstock CI is passing on all platforms: conda-forge/mayavi-feedstock#2
I just merged this PR, so mayavi should br available on Linux and Windows (in a few minutes), but not OSX (https://github.com/conda-forge/mayavi-feedstock/issues/3)
ImportError: No module named vtkRenderingOpenGLPython
I'll try to reproduce this
Here https://circleci.com/gh/conda-forge/staged-recipes/12483?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link mayavi is installed from default (don't know the reason why).
On my Linux machine, this install mayavi from conda-forge:
conda create -n sufer mayavi python=2.7 imageio matplotlib mayavi nibabel numpy scipy
and this works:
source activate surfer
python -c 'import vtk'
python -c 'import mayavi'
mayavi --help
[EDIT] On last build https://circleci.com/gh/conda-forge/staged-recipes/12761?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link, mayavi is installed from conda-forge
I think py-surfer
recipe need to add libXt-devel
and mesa-libGLU-devel
to its yum_requirements.txt
, like the mayavi one
[Edit] or just like vtk's yum_requirements.txt
.
Is it possible to modify VTK recipe so that it is checked? (post install script, or something like this)
I think that is already the case?
test:
imports:
- vtk
- vtk.vtkChartsCore
- vtk.vtkCommonCore
- vtk.vtkFiltersCore
- vtk.vtkFiltersGeneric
- vtk.vtkGeovisCore
- vtk.vtkFiltersHybrid
- vtk.vtkIOCore
- vtk.vtkImagingCore
- vtk.vtkInfovisCore
- vtk.vtkRenderingCore
- vtk.vtkViewsCore
- vtk.vtkRenderingVolume
- vtk.vtkInteractionWidgets
Here https://circleci.com/gh/conda-forge/staged-recipes/12483?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link mayavi is installed from default (don't know the reason why).
Yes strange, this is still the same in the latest build, for the build it's pulling mayavi
from defaults
, but for the test it's pulling from conda-forge
. The only difference in the requirements is that build also has setuptools
, that can hardly be the reason? A difference in channel priorities?
Care to share your conda config --get
and conda info
?
The latest few versions of conda and conda-build are notoriously buggy by the way, we've been having weird hiccups for the last two weeks for all sorts of stuff...
@Korijn I was referring to the build on circleci (linked), not my machine.
Closing, since updating yum_requirements
solved my issue. Thanks!
@christianbrodbeck thanks, I think we should find a way to make it more explicit, document it, or check it before the error occurs to provide to explict warning. Without a doubt, the error will reappear for other users...
It was surprising for me to see that it raised an ImportError at the python level and not at the dll/so level... I'm having a hard time believing that the either of them was really missing. They just failed to load.
Could a comment be added to the VTK feedstock readme? Something like "Projects that depend on VTK should add a yum_requirements.txt
file like vtk-feedstock/recipe/yum_requirements.txt
. Failure to do so can result in an ImportError: No module named vtkRenderingOpenGLPython
."? That would show up when searching for "vtkRenderingOpenGLPython".
It was surprising for me to see that it raised an ImportError at the python level and not at the dll/so level
Yes that was confusing for me too, maybe VTK could be modified to raise a more meaningful error? I am not familiar with the VTK source though... searching for "vtkRenderingOpenGLPython" does not even yield any results...
Could a comment be added to the VTK feedstock readme?
As README are generated by conda-smithy, is it ok to modify them?
Right... is there any way to add notes to a feedstock except for comments in the meta.yaml
which seem to be discouraged?
@christianbrodbeck VTK autogenerates the Python wrappers with lots of CMake magic, see: https://github.com/Kitware/VTK/blob/0937c8a6be8a10b95828c31b289cd1cecce78432/CMake/vtkPythonWrapping.cmake
Comments in the recipe are ok. We just try to remove boilerplate comments that come from copying and tweaking the example
at staged-recipes
.
Also it is possible to add a README to the recipe
directory. Here's an example (albeit not the prettiest one).
Hi i'm trying to install "mayavi". So i installed all the prerequisite packages including vtk. But after type enter "pip install mayavi" into my ubuntu 16.04 shell, i get a similar error: "from vtkOpenGLKitPython import * ModuleNotFoundError: No module named 'vtkOpenGLKitPython'"
How can i fix this error. I did not get your solution "christianbrodbeck"?
ImportError: No module named 'vtkOpenGLKitPython'
@kazemSafari sorry I missed your comment, this issue is about conda-forge recipes, not local install issues. It looks like your VTK install failed somehow?
I'm trying to write a recipe that depends on mayavi and hence vtk, and for Linux it ends with the traceback below. This looks like something is missing after the vtk install through conda-forge? Or is there a workaround for this, in which case maybe vtk could raise a better error message?