5

I have installed mayavi to spyder in windows 7 and when I am trying to import mlab I get a strange warning:

ImportError: No module named traits.api

Does anybody have experienced the same problem? Any suggestions? Thanks a lot in advance.

GioR
  • 596
  • 2
  • 8
  • 19

2 Answers2

2

You need to install the mayavi dependencies VTK, appinst, apptools, envisage, traitsui, traits, pyface, configobj

Jonathan March
  • 5,800
  • 2
  • 14
  • 16
  • Thanks Jonathan, I have installed all the dependencies though. The problem is caused by the traits package. When I am trying to install traits I get this error: c:\winpython-32bit-2.7.5.3\python-2.7.5\include\pyconfig.h(227) : fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory error: Setup script exited with error: command '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2 – GioR Nov 12 '14 at 17:21
  • Thanks! For people using anaconda, the command is `conda install -c anaconda vtk apptools envisage traitsui traits pyface configobj`. Afterwards, I was getting an error with `vtk` which was fixed when I reinstalled `mayavi` (which downgraded `vtk` to the proper version). – crypdick Apr 29 '16 at 19:13
1

Ok, I found a very useful post which solved the issue. The problem was that I had set PATH variable for searching for the basetsd.h instead of INCLUDE (C:\Program Files\Microsoft SDKs\Windows\v7.0\Include). Moreover, I set LIB for C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib.

Now I can successfully run mayavi on windows 7 and Spyder. However, I cannot run it from IPython :(

GioR
  • 596
  • 2
  • 8
  • 19