Python 3.x 在Mac OS上使用conda安装PyQt5时遇到问题

Python 3.x 在Mac OS上使用conda安装PyQt5时遇到问题,python-3.x,pyqt5,conda,Python 3.x,Pyqt5,Conda,我想它告诉我它想使用Python 3.7,但消息令人困惑,因此我将3.7作为终端shell的默认值,但我仍然得到以下信息: dzimmerman@QA-Bonjour-OSX ~ % python --version Python 3.7.2 dzimmerman@QA-Bonjour-OSX ~ % conda install -c dsdale24 pyqt5 Collecting package metadata (current_repodata.json): done Solving

我想它告诉我它想使用Python 3.7,但消息令人困惑,因此我将3.7作为终端shell的默认值,但我仍然得到以下信息:

dzimmerman@QA-Bonjour-OSX ~ % python --version
Python 3.7.2
dzimmerman@QA-Bonjour-OSX ~ % conda install -c dsdale24 pyqt5
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: - 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - pyqt5 -> python=2.7

Your python: python=3.7

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

您尝试使用的频道中的
pyqt5
包仅为python 2.7编译

您应该使用conda forge的版本,该版本还提供了pyqt5,并且在OsX上有pyhton 3.7的版本:

conda install -c conda-forge pyqt

我想上面说pyqt5是为2.7而不是3.7编译的。感谢您成功安装。当我尝试运行Pyqt“Hello World”时,我仍在尝试解决另一个问题(这就是为什么我希望终端安装Pyqt),它给了我以下信息:dzimmerman@QA-Bonjour OSX Desktop%python3 Build.py回溯(最后一次调用):文件“Build.py”,第10行,从PyQt5.qtwidts导入QApplication,QLabel,QMainWindow#QWidget ModuleNotFoundError:没有名为“PyQt5”的模块。我尝试过在几乎所有地方添加路径,但都没有效果!