我已经安装了 Python 3.3.2(x86 和 x64 版本)并在它们之上安装了 PyQt5.1。
最近我安装了 PyCharm 3.0 社区版并配置为使用这些 Python 解释器。问题是 PyQt5 未显示在已安装包的列表中,并且文档不起作用(Ctrl+Space
自动完成和Ctrl+Q
文档)。
当 PyCharm 查询骨架生成时,它似乎在处理 PyQt 但没有用。当我尝试使用 PyCharm 中的包系统安装 PyQt 时,出现以下错误:
C:\Program Files (x86)\PyCharm3.0\helpers\packaging_tool.py run on 10/06/13 13:58:52
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:\Python\332_x64\lib\site-packages\pip-1.4.1-py3.3.egg\pip\basecommand.py", line 134, in main
status = self.run(options, args)
File "C:\Python\332_x64\lib\site-packages\pip-1.4.1-py3.3.egg\pip\commands\install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python\332_x64\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 1085, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "C:\Python\332_x64\lib\site-packages\pip-1.4.1-py3.3.egg\pip\index.py", line 265, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
错误:
pip.exceptions.DistributionNotFound: No distributions at all found for PyQt5
但这似乎是无关的问题。
PyQt5 使用二进制安装程序安装。系统是Win 7 x64。
更新:我发现以前索引中的日志无效,我试图让事情正常进行。该日志不包含有关 PyQt 的错误或警告。具体内容如下:
INFO - .skeletons.PySkeletonRefresher - Home path is C:\Program Files (x86)\PyCharm3.0
INFO - .skeletons.PySkeletonRefresher - Pregenerated skeletons root is C:\Program Files (x86)\PyCharm3.0\skeletons
INFO - .skeletons.PySkeletonRefresher - Not found pregenerated skeletons at C:\Program Files (x86)\PyCharm3.0\skeletons\skeletons-win-386-python-3.3.2.zip
INFO - .skeletons.PySkeletonGenerator - Rebuilding builtin skeletons took 10947 ms
INFO - .skeletons.PySkeletonRefresher - Skeleton for PyQt5.QAxContainer
<...>
INFO - .skeletons.PySkeletonRefresher - Skeleton for PyQt5._QOpenGLFunctions_ES2
也许一些问题在于打包工具:
INFO - packaging.PyPackageManagerImpl - Running packaging tool: C:/Python/332_x64/python.exe C:\Program Files (x86)\PyCharm3.0\helpers\packaging_tool.py list
但是仍然没有报告错误。