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

vtk broken? #21

Closed
christianbrodbeck opened this issue Jan 25, 2017 · 26 comments
Closed

vtk broken? #21

christianbrodbeck opened this issue Jan 25, 2017 · 26 comments

Comments

@christianbrodbeck
Copy link
Member

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?

Traceback (most recent call last):
  File "/staged-recipes/build_artefacts/pysurfer_1485201053033/_t_env/bin/pysurfer", line 9, in <module>
    from surfer._commandline import parser
  File "/staged-recipes/build_artefacts/pysurfer_1485201053033/_t_env/lib/python2.7/site-packages/surfer/__init__.py", line 1, in <module>
    from .viz import Brain, TimeViewer  # noqa
  File "/staged-recipes/build_artefacts/pysurfer_1485201053033/_t_env/lib/python2.7/site-packages/surfer/viz.py", line 13, in <module>
    from mayavi import mlab
  File "/staged-recipes/build_artefacts/pysurfer_1485201053033/_t_env/lib/python2.7/site-packages/mayavi/mlab.py", line 27, in <module>
    from mayavi.tools.camera import view, roll, yaw, pitch, move
  File "/staged-recipes/build_artefacts/pysurfer_1485201053033/_t_env/lib/python2.7/site-packages/mayavi/tools/camera.py", line 25, in <module>
    from .engine_manager import get_engine
  File "/staged-recipes/build_artefacts/pysurfer_1485201053033/_t_env/lib/python2.7/site-packages/mayavi/tools/engine_manager.py", line 14, in <module>
    from mayavi.core.engine import Engine
  File "/staged-recipes/build_artefacts/pysurfer_1485201053033/_t_env/lib/python2.7/site-packages/mayavi/core/engine.py", line 12, in <module>
    import vtk
  File "/staged-recipes/build_artefacts/pysurfer_1485201053033/_t_env/lib/python2.7/site-packages/vtk/__init__.py", line 100, in <module>
    from .vtkRenderingOpenGL import *
  File "/staged-recipes/build_artefacts/pysurfer_1485201053033/_t_env/lib/python2.7/site-packages/vtk/vtkRenderingOpenGL.py", line 9, in <module>
    from vtkRenderingOpenGLPython import *
ImportError: No module named vtkRenderingOpenGLPython
@Korijn
Copy link
Contributor

Korijn commented Jan 26, 2017

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.

@christianbrodbeck
Copy link
Member Author

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 (ContinuumIO/anaconda-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)

@Korijn
Copy link
Contributor

Korijn commented Jan 26, 2017

You are right.

I'm confused though; the mayavi-feedstock CI is passing on all platforms: conda-forge/mayavi-feedstock#2

You'd think this error would occur there as well, hm?

@christianbrodbeck
Copy link
Member Author

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.

@Korijn
Copy link
Contributor

Korijn commented Jan 26, 2017

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

@dfroger
Copy link
Contributor

dfroger commented Jan 27, 2017

requires vtk ==7.1.0

There is a discussion about that: conda-forge/mayavi-feedstock#1

@dfroger
Copy link
Contributor

dfroger commented Jan 27, 2017

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 (conda-forge/mayavi-feedstock#3)

@dfroger
Copy link
Contributor

dfroger commented Jan 27, 2017

ImportError: No module named vtkRenderingOpenGLPython

I'll try to reproduce this

@dfroger
Copy link
Contributor

dfroger commented Jan 27, 2017

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

@dfroger
Copy link
Contributor

dfroger commented Jan 27, 2017

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.

@dfroger
Copy link
Contributor

dfroger commented Jan 27, 2017

Is it possible to modify VTK recipe so that it is checked? (post install script, or something like this)

@Korijn
Copy link
Contributor

Korijn commented Jan 27, 2017

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

@christianbrodbeck
Copy link
Member Author

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?

@Korijn
Copy link
Contributor

Korijn commented Jan 27, 2017

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...

@christianbrodbeck
Copy link
Member Author

@Korijn I was referring to the build on circleci (linked), not my machine.

@christianbrodbeck
Copy link
Member Author

Closing, since updating yum_requirements solved my issue. Thanks!

@dfroger
Copy link
Contributor

dfroger commented Jan 31, 2017

@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...

@Korijn
Copy link
Contributor

Korijn commented Jan 31, 2017

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.

@christianbrodbeck
Copy link
Member Author

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...

@dfroger
Copy link
Contributor

dfroger commented Jan 31, 2017

Could a comment be added to the VTK feedstock readme?

As README are generated by conda-smithy, is it ok to modify them?

@christianbrodbeck
Copy link
Member Author

Right... is there any way to add notes to a feedstock except for comments in the meta.yaml which seem to be discouraged?

@Korijn
Copy link
Contributor

Korijn commented Jan 31, 2017

@christianbrodbeck VTK autogenerates the Python wrappers with lots of CMake magic, see: https://github.com/Kitware/VTK/blob/0937c8a6be8a10b95828c31b289cd1cecce78432/CMake/vtkPythonWrapping.cmake

@jakirkham
Copy link
Member

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).

@kazemSafari
Copy link

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"?

@mustafa-qamaruddin
Copy link

ImportError: No module named 'vtkOpenGLKitPython'

@christianbrodbeck
Copy link
Member Author

@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?

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

6 participants