简体   繁体   English

如何在Anaconda 4.3.X版上安装PyQt4

[英]How do I install PyQt4 on Anaconda version 4.3.X

I'm trying to downgrade my current version of PyQt5 to PyQt4 temporarily. 我正在尝试将当前版本的PyQt5暂时降级为PyQt4。 However, this command conda install pyqt=4.11 only yields this error. 但是,此命令conda install pyqt=4.11仅产生此错误。

UnsatisfiableError: The following specifications were found to be in conflict:
  - pyqt 4.11* -> python 2.7*
  - python 3.6*

What can I do to fix this? 我该怎么做才能解决此问题?

Use: conda info pyqt=4 使用: conda info pyqt=4

You can see which Python Versions are working. 您可以看到哪些Python版本正在运行。 At the moment, the latest Python3 working with pyqt4 is 3.5 目前,与pyqt4配合使用的最新Python3为3.5

Now: 现在:

# Create new environment with python 3.5
conda create -n py35_qt4 python=3.5 anaconda

# Activate the new environment
activate py35_qt4

# Remove pyqt5
conda remove pyqt

# Install the PyQt4 package in the new environment
conda install pyqt=4

PyQt4 only works with Python 2, while PyQt5 only work with Python 3. You are probably trying to install PyQt4 in a Python 3 environment. PyQt4仅适用于Python 2,而PyQt5仅适用于Python3。您可能正在尝试在Python 3环境中安装PyQt4。 I recommend you to create a new anaconda environment with Python 2 and then install PyQt4. 我建议您使用Python 2创建一个新的anaconda环境,然后安装PyQt4。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM