win10 Anaconda import mlab error :Invalid Qt API 'pyqt5', valid values are: 'pyqt' or 'pyside'

来源:互联网 发布:淘宝直播间看不到聊天 编辑:程序博客网 时间:2024/06/03 19:22

anaconda版本:Anaconda2-4.4.0-Windows-x86_64

mayavi 安装包来源:http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-image  mayavi-4.5.0+vtk71-cp27-cp27m-win_amd64.whl

  • spyder:python 2.7.13 64bits, Qt 5.6.2, pyQt5.6 on windows
参考解决方案:https://github.com/enthought/mayavi/issues/448

conda create -n oldqt python=2 pyqt=4

activate oldqt

conda install -c menpo mayavi

结果为:

(oldqt) D:\python_extension_packages>conda install -c menpo mayavi
Fetching package metadata .............
Solving package specifications: .
Package plan for installation in environment C:\Anaconda2\envs\oldqt:

The following NEW packages will be INSTALLED:

    apptools:  4.4.0-py27_0  menpo
    configobj: 5.0.6-py27_0
    envisage:  4.5.1-py27_0  menpo
    hdf5:      1.8.17-vc9_0        [vc9]
    mayavi:    4.5.0-py27_0  menpo
    mkl:       2017.0.3-0
    numpy:     1.13.1-py27_0
    pyface:    5.1.0-py27_0  menpo
    pygments:  2.2.0-py27_0
    six:       1.10.0-py27_0
    traits:    4.5.0-py27_0  menpo
    traitsui:  5.1.0-py27_0  menpo
    vtk:       7.0.0-py27_0  menpo

Proceed ([y]/n)? y


mkl-2017.0.3-0 100% |###############################| Time: 0:05:33 396.60 kB/s
mkl-2017.0.3-0 100% |###############################| Time: 0:02:40 825.80 kB/s
mkl-2017.0.3-0  48% |###############                | Time: 1:17:30  13.83 kB/s

频繁下载中断,无法继续进行。


参考解决方案:https://github.com/hyperspy/hyperspy/issues/1616

 当我输入conda install pyqt=4.11.4时出现如下错误。

然后,updating pyface and traitsui : 

pip install https://github.com/enthought/pyface/archive/master.zip

pip install https://github.com/enthought/traitsui/archive/master.zip 

随后在spyder中输入 from mayavi import mlab 报错:no Pyface plugin found for toolkit 'qt4'

UnsatisfiableError: The following specifications were found to be in conflict:

  - navigator-updater -> pyqt >=5.6 -> qt 5.6.0
  - pyqt 4.11.4* -> qt >=4.8.6,<5.0
  - pyqt 4.11.4* -> sip >=4.16.4,<4.18

Use "conda info <package>" to see the dependencies for each package.

随后,

conda uninstall spyder

conda uninstall pyqt

conda uninstall qt

conda uninstall sip


conda install qt=4.8.7

The following NEW packages will be INSTALLED:


    qt:      4.8.7-vc9_9   [vc9]


The following packages will be UPDATED:


    conda:   4.3.21-py27_0 --> 4.3.25-py27_0


The following packages will be DOWNGRADED:


    jpeg:    9b-vc9_0      [vc9] --> 8d-vc9_2      [vc9]
    libtiff: 4.0.6-vc9_3   [vc9] --> 4.0.6-vc9_2   [vc9]
    pillow:  4.1.1-py27_0  --> 3.4.2-py27_0

conda install pyqt=4.11.4

The following NEW packages will be INSTALLED:


    pyqt: 4.11.4-py27_7
    sip:  4.18-py27_0

conda install spyder

The following NEW packages will be INSTALLED:


    pycodestyle: 2.3.1-py27_0
    qtconsole:   4.2.1-py27_0
    spyder:      3.2.1-py27_0

Proceed ([y]/n)? y


pycodestyle-2. 100% |###############################| Time: 0:00:07  13.63 kB/s
qtconsole-4.2. 100% |###############################| Time: 0:00:07  28.19 kB/s
spyder-3.2.1-p 100% |###############################| Time: 0:01:19  32.11 kB/s
INFO menuinst_win32:__init__(182): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:\Anaconda2', env_name: 'None', mode: 'None', used_mode: 'user'
INFO menuinst_win32:__init__(182): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:\Anaconda2', env_name: 'None', mode: 'None', used_mode: 'user'


在win10搜索框中输入spyder运行后:help-->about spyder打开后可看到:Python 2.7.13 64bits, Qt 4.8.7, PyQt(API v2) 4.11.4 on windows.

再次输入from mayavi import mlab 出现错误:ImportError: numpy.core.multiarray failed to import

http://www.bozhiyue.com/cloud/2016/0825/432191.html

输入pip install --upgrade numpy 将numpy-1.12.1 更新至numpy-1.13.1

再次输入from mayavi import mlab 无报错:from mayavi import mlab  Changing backend to Qt for Mayavi

阅读全文
0 0
原创粉丝点击