[vtkusers] No module named vtk when installing mayavi

KIM TRAN DONG kimtran1208 at gmail.com
Fri Aug 21 04:30:41 EDT 2015


Dear VTK users,

I'm using Mac 10.9 Maverick on vmware 11, and I want to install VTK for
Mayavi, so I download vtk from source and build with Cmake Gui with these
options:
BUILD_DOCUMENTATION:BOOL=OFF
BUILD_EXAMPLES:BOOL=OFF
BUILD_SHARED_LIBS:BOOL=ON
BUILD_TESTING:BOOL=OFF

Module_AutobahnPython:BOOL=ON
Module_SixPythonMBOOL=ON
Module_vtkPython:BOOL=ON
Module_vtkPythonInterpreter:BOOL=ON

VTK_WRAP_PYTHON:BOOL=ON
VTK_WRAP_TCL:BOOL=ON

I set path in .bash_profile like this:
export LD_LIBRARY_PATH=/usr/local/VTKBuild/lib:${LD_LIBRARY_PATH}

export DYLD_LIBRARY_PATH=/usr/local/VTKBuild/lib:${DYLD_LIBRARY_PATH}

export
PYTHONPATH=/usr/local/VTKBuild/Wrapping/Python/vtk:/usr/local/VTKBuild/Wrapping/Python:$PYTHONPATH

export PATH=/usr/local/VTKBuild/bin:$PATH

Everything seems ok:

$vtkpython
vtk version 6.3.0
Python 2.7.5 (default, Mar  9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from vtk import *
>>> vtk
<module 'vtk' from '/usr/local/VTKBuild/Wrapping/Python/vtk/__init__.pyc'>
>>>

But when I install mayavi-4.4.3, I get this error (entier message in
attached file):
  ....
  File "tvtk/code_gen.py", line 10, in <module>
    import vtk
ImportError: No module named vtk

I also get this message when typing 'import vtkpython' in python:

$ python
Python 2.7.5 (default, Mar  9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import vtkpython
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named vtkpython

By the way, I have this lines when I open a terminal, I don't know if it
has any effects on the bash?:
-bash: Desktop: command not found
-bash: Desktop: command not found
-bash: Desktop: command not found
-bash: Desktop: command not found
-bash: Desktop: command not found

I've searched in many forum but I didn't find the solution. Does anyone
know how to fix it, any help would be greatly appreciated?

Thank you very much,

Kim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150821/a14adcdc/attachment.html>
-------------- next part --------------
$ sudo python setup.py install

running install
Checking .pth file support in /Library/Python/2.7/site-packages
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages appears to support .pth files
running bdist_egg
running egg_info
running build_src
build_src
building extension "tvtk.array_ext" sources
building data_files sources
build_src: building npy-pkg config files
writing requirements to mayavi.egg-info/requires.txt
writing mayavi.egg-info/PKG-INFO
writing top-level names to mayavi.egg-info/top_level.txt
writing dependency_links to mayavi.egg-info/dependency_links.txt
writing entry points to mayavi.egg-info/entry_points.txt
reading manifest file 'mayavi.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/pdf'
writing manifest file 'mayavi.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.9-intel/egg
running install_lib
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
running scons
creating stub loader for tvtk/array_ext.so
byte-compiling build/bdist.macosx-10.9-intel/egg/tvtk/array_ext.py to array_ext.pyc
installing package data to build/bdist.macosx-10.9-intel/egg
running install_data
Traceback (most recent call last):
  File "setup.py", line 471, in <module>
    **config
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/distutils/core.py", line 186, in setup
    return old_setup(**new_attr)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/distutils/command/install.py", line 57, in run
    r = self.setuptools_run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/distutils/command/install.py", line 51, in setuptools_run
    self.do_egg_install()
  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/install.py", line 109, in do_egg_install
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/bdist_egg.py", line 180, in run
  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/bdist_egg.py", line 132, in do_install_data
  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/bdist_egg.py", line 146, in call_command
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 356, in run
    build_tvtk_classes_zip()
  File "setup.py", line 290, in build_tvtk_classes_zip
    gen_tvtk_classes_zip()
  File "tvtk/setup.py", line 46, in gen_tvtk_classes_zip
    from code_gen import TVTKGenerator
  File "tvtk/code_gen.py", line 10, in <module>
    import vtk
ImportError: No module named vtk


More information about the vtkusers mailing list