python海洋里的小鱼干
2022-02-06 16:45
采纳率: 100%
浏览 281

python安装mayavi后报错AttributeError

我用最近在安装mayavi,用的anaconda创建了一个python3.6的虚拟环境(py36),再用网上搜到的方法, 按照顺序先后再anaconda Promot 上 用pip install 了

mayavi-4.7.1+vtk82-cp36-cp36m-win_amd64.whl
traits-6.1.1-cp36-cp36m-win_amd64.whl
VTK-8.2.0-cp36-cp36m-win_amd64.whl
mayavi-4.7.1+vtk82-cp36-cp36m-win_amd64.whl

之后我就在我的虚拟环境下新建了一个idle,在命令行里面就打一行代码:
from mayavi import mlab
然后出现了报错:

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    from mayavi import mlab
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\mayavi\mlab.py", line 16, in <module>
    from mayavi.tools.camera import view, roll, yaw, pitch, move
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\mayavi\tools\camera.py", line 24, in <module>
    from .engine_manager import get_engine
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\mayavi\tools\engine_manager.py", line 14, in <module>
    from mayavi.core.engine import Engine
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\mayavi\core\engine.py", line 29, in <module>
    from mayavi.core.scene import Scene
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\mayavi\core\scene.py", line 15, in <module>
    from mayavi.core.source import Source
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\mayavi\core\source.py", line 23, in <module>
    from mayavi.core.adder_node import ModuleFilterAdderNode
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\mayavi\core\adder_node.py", line 16, in <module>
    from pyface.api import ImageResource
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\pyface\api.py", line 105, in <module>
    from .about_dialog import AboutDialog
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\pyface\about_dialog.py", line 17, in <module>
    AboutDialog = toolkit_object("about_dialog:AboutDialog")
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\pyface\base_toolkit.py", line 127, in __call__
    module = import_module(mname, package)
  File "C:\ProgramData\Anaconda3\envs\py36\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\pyface\ui\qt4\about_dialog.py", line 20, in <module>
    from .dialog import Dialog
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\pyface\ui\qt4\dialog.py", line 29, in <module>
    int(QtGui.QDialog.DialogCode.Accepted): OK,
AttributeError: type object 'DialogCode' has no attribute 'Accepted'

我上网搜了一下,在电脑 控制面板中的高级设置中修改了一下环境,还是报一样的错

我就想是不是安装的时候出问题了?如果有问题,我该怎么安装呢?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题