Mayavi在MacOS 10.12上遇到“非法硬件指令”崩溃

时间:2017-04-27 07:04:56

标签: python macos mayavi

Mayavi在我的MacOS 10.12上崩溃了。有什么建议吗?

我用

安装了mayavi和vtk
$ brew install vtk
$ pip install --user mayavi

当我在python2.7中运行mayavi2或导入mayavi.lab时,它会崩溃

$ mayavi2
[1]    93511 illegal hardware instruction  mayavi2

$ python2 -c "import mayavi.mlab"
[1]    93920 illegal hardware instruction  python2 -c "import mayavi.mlab"

更新

我发现问题可能在traitsui.api中导入mayavi.preferences.preference_manager

$ python2 -c "import traitsui.api"
[1]    2421 illegal hardware instruction  python2 -c "import traitsui.api"

UPDATE2

更深入,我发现它是关于“traits.api.Color”...用于traitsui.editors.code_editor

$ python -c "from traits.api.Color; print 'hi'; Color( 0xECE9D8 )"
hi
[1]    6414 illegal hardware instruction  python2 -c "from traits.api import Color; print 'hi'; Color(0xECE9D8)"

1 个答案:

答案 0 :(得分:0)

感谢@PierredeBuyl的建议。

我尝试重新安装pyqt,现在可以正常使用了!

步骤如下:

$ brew install pyqt
Error: pyqt-4.11.3 already installed
To install this version, first `brew unlink pyqt`

$ brew unlink pyqt
Unlinking /usr/local/Cellar/pyqt/4.11.3... 78 symlinks removed

$ brew install pyqt
...

$ mayavi2    # now it works