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

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条回答 默认 最新

  • CSDN专家-HGJ 2022-02-06 17:54
    关注

    pyqt4在下一个pyface主版本升级后将被弃用,尝试升级一下pyface版本并安装相关依赖。

    https://docs.enthought.com/pyface/changelog.html#release-7-4-0

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 2月15日
  • 已采纳回答 2月7日
  • 创建了问题 2月6日

悬赏问题

  • ¥100 有偿求易语言word文档取doc和docx页数方法或模块
  • ¥15 找能接spark如图片的,可议价
  • ¥15 关于#单片机#的问题,请各位专家解答!
  • ¥15 博通raid 的写入速度很高也很低
  • ¥15 目标计数模型训练过程中的问题
  • ¥100 Acess连接SQL 数据库后 不能用中文筛选
  • ¥15 用友U9Cloud的webapi
  • ¥20 电脑拓展屏桌面被莫名遮挡
  • ¥20 ensp,用局域网解决
  • ¥15 Python语言实验