py27-mayavi: No module named wx

Jonathan Stickel jjstickel at
Mon Aug 13 07:31:04 PDT 2012

On 8/12/12 13:00 , macports-users-request at wrote:
> Date: Sat, 11 Aug 2012 23:16:47 -0400
> From: "alex m."
> Subject: py27-mayavi: No module named wx
> Hi,
> Per MacPorts' Mayavi maintainer's suggestion which was expressed in the
> last change to the ticket #34342, I would like to ask your help
> with figuring out the following problem:
> I have updated py-mayavi to 4.1.0 and got the error you can find at the end
> of this e-mail. It was also described in the comment 27 of the ticket
> #34432.
> As suggested in the ticket #34342, py26-envisagecore @3.2.0_0 and py26-traits
> @3.6.0_0 were uninstalled, vtk5 was uninstalled and installed like vtk5
> -tcltk -x11 +python27. py27-mayavi was uninstalled and installed again. The
> same error is still there. Interestingly, "port installed*traits*" and
> "port installed*envi*" now give:
> (now):
> port installed*traits*
> The following ports are currently installed:
>    py26-traits @4.1.0_0 (active)
>    py26-traitsui @4.1.0_0 (active)
>    py27-traits @4.1.0_0 (active)
>    py27-traitsui @4.1.0_0 (active)
> (now):
> port installed*envi*
> The following ports are currently installed:
>    py26-envisage @4.1.0_0 (active)
>    py27-envisage @4.1.0_0 (active)
> The error message:
> ###
> ... : mayavi2-2.7
> Warning: Unable to import the wx backend for pyface due to traceback:
> Traceback (most recent call last):
> ImportError: No module named wx
> Traceback (most recent call last):
>    File "/opt/local/bin/mayavi2-2.7", line 9, in <module>
>      load_entry_point('mayavi==4.1.0', 'console_scripts', 'mayavi2')()
> ImportError: No module named configobj
> ________________________________________________________________________________
> Could not load envisage. You might have a missing dependency.
> Do you have the EnvisageCore and EnvisagePlugins installed?
> If you installed Mayavi with easy_install, try 'easy_install <pkg_name>'.
> 'easy_install Mayavi[app]' will also work.
> If you performed a source checkout and installed via 'python
> develop',
> be sure to run the same command in the EnvisageCore and EnvisagePlugins
> folders.
> If these packages appear to be installed, check that your numpy and
> configobj are installed and working. If you need numpy, 'easy_install numpy'
> will install numpy. Similarly, 'easy_install configobj' will install
> configobj.
> ###

If you use the QT4 backend (rather than wx), the warning/error messages 
about wx can be ignored. This is a bug in Mayavi itself. I see them also.

I am confused as to why you have py26-* ports installed. Do need mayavi 
installed with both python-2.6 and python-2.7?

Regarding the error message about configobj, I think this is the real 
problem. Do you have py27-configobj installed? If not, please install 
and try again. It looks like it may be a dependency that I missed. It 
got pulled in for matplotlib on my system, and so I didn't notice. I 
will try to hunt this down.


Mayavi-4.1 (and 4.2) have some bugs with VTK-5.10, e.g. text actors such 
as titles give errors. I plan to wait until Mayavi-4.3 is released, but 
I would respond to a patch to Mayavi-4.1 or 4.2.

More information about the macports-users mailing list