Having installed FiPy using pip with a brew installation of Python 2.7.3 on OSX 10.8.2, I ran the following sample test code:
from fipy import *
mesh = Grid3D(nx=50, ny=100, nz=10, dx=0.1, dy=0.01, dz=0.1)
x, y, z = mesh.cellCenters
xyzVar = CellVariable(mesh=mesh, name=r"x y z", value=x * y * z)
k = Variable(name="k", value=0.)
viewer = MayaviClient(vars=numerix.sin(k * xyzVar), limits={'ymin': 0.1, 'ymax': 0.9}, datamin=-0.9, datamax=2.0, title="MayaviClient test")
for kval in range(10):
k.setValue(kval)
viewer.plot()
viewer._promptForOpinion()
which generated the following error:
File "/usr/local/lib/python2.7/site-packages/pyface/qt/__init__.py", line 17, in prepare_pyqt4
sip.setapi('QString', 2)
ValueError: API 'QString' has already been set to version 1
I decided to see how far I could get by commenting out sip.setapi('QString', 2) and sip.setapi('QVariant', 2) in prepare_pyqt4. This simple hack got passed the versioning issue but presented a new problem.
File "/Library/Python/2.7/site-packages/fipy/viewers/mayaviViewer/mayaviDaemon.py", line 79, in <module>
from enthought.mayavi.plugins.app import Mayavi
ImportError: No module named enthought.mayavi.plugins.app
It seems now the FiPy Mayavi viewer is lacking a module.
I think my site-packages should all be in the same location too. Looks like pip installs to /Library/Python/2.7/site-packages while brew installs to /usr/local/lib/python2.7/site-packages, something I have to fix up (I think the problem is with pip).
The question I have is how can I get a clean FiPy installation working with Mayavi (without generating these errors) and fix up my site-packages?