在 python 3 中难以使用 mayavi

difficulty using mayavi in python 3

我在windows上用的是python 3.5,按照mayavi的教程,用的是python 2.7,根据我以前的经验,版本应该不会是一个很大的障碍,但事实证明这是一个很大的障碍。这是一个简单的测试代码:

import numpy as np
from mayavi import mlab
t = np.linspace(0, 4 * np.pi, 50)
x = np.sin(2 * t)
y = np.cos(t)
z = np.cos(2 * t)
s = 1 + np.sin(t)
mlab.points3d(x, y, z, s)  

这就是我得到的(我的文件夹名称被删除)

Traceback (most recent call last):
  File "C:\...\PlotsPartOne.py", line 602, in <module>
    Main()
  File "C:\...\PlotsPartOne.py", line 590, in Main
    mayaviTest()
  File "C:\...\PlotsPartOne.py", line 582, in mayaviTest
    mlab.points3d(x, y, z, s)
  File "C:\Users\...\Anaconda3\lib\site-packages\mayavi-4.5.0-py3.5-win-amd64.egg\mayavi\tools\helper_functions.py", line 37, in the_function
    return pipeline(*args, **kwargs)
  File "C:\Users\...\Anaconda3\lib\site-packages\mayavi-4.5.0-py3.5-win-amd64.egg\mayavi\tools\helper_functions.py", line 77, in __call__
    scene = tools.gcf().scene
  File "C:\Users\...\Anaconda3\lib\site-packages\mayavi-4.5.0-py3.5-win-amd64.egg\mayavi\tools\figure.py", line 113, in gcf
    engine = get_engine()
  File "C:\Users\...\Anaconda3\lib\site-packages\mayavi-4.5.0-py3.5-win-amd64.egg\mayavi\tools\engine_manager.py", line 101, in get_engine
    return self.new_engine()
  File "C:\Users\...\Anaconda3\lib\site-packages\mayavi-4.5.0-py3.5-win-amd64.egg\mayavi\tools\engine_manager.py", line 146, in new_engine
    check_backend()
  File "C:\Users\...\Anaconda3\lib\site-packages\mayavi-4.5.0-py3.5-win-amd64.egg\mayavi\tools\engine_manager.py", line 49, in check_backend
    ''')
ImportError: Could not import backend for traits
_______________________________________________________________________________
Make sure that you have either the TraitsBackendWx or the TraitsBackendQt
projects 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, be sure to run 'python setup.py install'
in Traits, TraitsGUI, and the Traits backend of your choice.

Also make sure that either wxPython or PyQT is installed.
wxPython: http://www.wxpython.org/
PyQT: http://www.riverbankcomputing.co.uk/software/pyqt/intro

而且我很确定我已经安装了 wxPython、traits 和 PyQt(版本 5),但不确定是否安装了 TraitsBackendWx 或 TraitsBackendQt,我搜索了,但没有找到任何可用的包 python 3... 但是 sence mayavi 有一个 python 3 版本,必须有一种方法可以在 python 3(我想...)上使用 运行 mayavi 代码。那么,有什么办法可以解决这个问题吗?

TraitsBackendWx, TraitsBackendQt, Traits, TraitsGUI, Traits backend, wxPython or PyQT 这些包我都不缺,我需要的是 PySide 包...

pip install PySide-1.2.4-cp35-cp35m-win_amd64.whl

包裹(来自第三方,请注意)位于 https://github.com/krrr/PySide/releases/download/1.2.4-1/PySide-1.2.4-cp35-cp35m-win_amd64.whl

我通过以下方式在 ubuntu 中使用它: sudo apt-get 安装 python3-pyside

其他相关模块是: vtk 8.1.0 玛雅维 4.5.0 python3.5.2