Python 为什么我不能从 pypi 安装 PyQt5?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/21577723/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why can't I install PyQt5 from the pypi?
提问by ehsan shirzadi
I want to use PyQt5 in pycharm. After trying to install the package from Available packages, an error says: 'Install packages failed: Error occurred when installing package PyQt5.'
The complete log is here:  
我想在 pycharm 中使用 PyQt5。尝试从可用包安装包后,出现错误提示:“安装包失败:安装包 PyQt5 时发生错误”。
完整的日志在这里:  
------------------------------------------------------------
C:\Program Files (x86)\JetBrains\PyCharm 3.0.1\helpers\packaging_tool.py run on 02/05/14 16:13:23
Downloading/unpacking PyQt5
  Getting page https://pypi.python.org/simple/PyQt5/
  URLs to search for versions for PyQt5:
  * https://pypi.python.org/simple/PyQt5/
  Analyzing links from page https://pypi.python.org/simple/PyQt5/
  Could not find any downloads that satisfy the requirement PyQt5
No distributions at all found for PyQt5
Exception information:
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\basecommand.py", line 139, in main
    status = self.run(options, args)
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\commands\install.py", line 266, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\req.py", line 1026, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\index.py", line 171, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for PyQt5
What should I do?
我该怎么办?
This is what I've done is this:
这就是我所做的:
- Installed Python 3.3 and added to PATH
 - Installed 
PyQt5-5.2-gpl-Py3.3-Qt5.2.0-x64.exe 
- 安装 Python 3.3 并添加到 PATH
 - 已安装 
PyQt5-5.2-gpl-Py3.3-Qt5.2.0-x64.exe 
And I don't know how to use PyQtin pycharm.
can you provide more information?
而且我不知道如何PyQt在pycharm中使用。
你能提供更多信息吗?
采纳答案by gravetii
AFAIK, you cannot install PyQt4/PyQt5 from PyPI. You would have to install it separately.
AFAIK,你不能从 PyPI 安装 PyQt4/PyQt5。您必须单独安装它。
If you see thislink, you can see that there are no listed packages for PyQt5 (likewise for PyQt4) on PyPI. So, you would need to download the installer separately from hereand install it.
如果你看到这个链接,你可以看到 PyPI 上没有列出 PyQt5(PyQt4 也是如此)的包。因此,您需要从此处单独下载安装程序并进行安装。
That is what the
那是什么
DistributionNotFound: No distributions at all found for PyQt5
DistributionNotFound:根本找不到 PyQt5 的发行版
refers to.
指。
[UPDATE]: You'll also most likely need to install sip the same way, here's how: https://askubuntu.com/a/666336/12214
[更新]:您也很可能需要以相同的方式安装 sip,方法如下:https: //askubuntu.com/a/666336/12214
回答by Andreas Haferburg
FYI, installing QtPy5 with pip works in 3.6.5. According to https://www.riverbankcomputing.com/software/sip/downloadeven 3.5 and later.
仅供参考,使用 pip 安装 QtPy5 可以在 3.6.5 中运行。根据https://www.riverbankcomputing.com/software/sip/download甚至 3.5 及更高版本。

