我尝试用pip安装pytq5并得到这个错误
$ python3 -m pip install PyQt5
Collecting PyQt5
Using cached PyQt5-5.15.6.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [29 lines of output]
Traceback (most recent call last):
File "/Users/olivierskonieczny/Desktop/app/python/ObjectDetection/envs/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/olivierskonieczny/Desktop/app/python/ObjectDetection/envs/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
...
...
...
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
我仍然可以安装其他软件包,如lxml,但不能安装pytq5。我正在虚拟环境中安装所有的东西。
有什么主意吗?
发布于 2022-04-19 20:25:45
好的,我在python中遇到了这个问题,在搜索之后,我找到了两个解决这个问题的方法,因为这个问题不仅存在于3.10.4
中,还存在于其他库中。
#注:如果您有上述问题,这些解决方案可供下载任何库,而我在windows中遇到了这些问题。
所以你可以试试这个方法:
pip install turtle==0.0.1
0.0.1
--这是库的最后一个版本,因此您应该找到要为此目的安装的库的版本,可以使用以下命令找到库的版本:
pip show module <name_of_the_library>
另一个可行的解决方案是使用--use-deprecated=backtrack-on-build-failures
。
示例:
pip install turtle --use-deprecated=backtrack-on-build-failures
希望能帮助你。
发布于 2022-02-07 14:09:14
最近我也遇到了同样的问题。当您查看PyPi下载站点时,您可以在Installation章节中读到您需要“Qt的qmake工具在路径上”。在安装了Qt的开发文件之后,一切对我来说都很好。因此,首先安装它,并确保它在您的道路上,而不是再尝试。
sudo apt-get install qtbase5-dev
pip install pyqt5
PS:我认为这与您的python或pip版本无关。我尝试了很多版本,每次都有这个问题。它只是缺少、损坏或找不到来自qt5的头开发文件。
你好,瓦利
发布于 2022-02-07 13:35:59
与@ when 1124一样,我在下载工具(又名pyqt5- tools )时也解决了同样的问题。经过多次尝试,我发现将python降级为3.9.x (特别是3.9.9)版本很有帮助。如果您目前有python 3.10,它可能会有帮助,但否则,idk.
我尝试过的其他方法没有解决这个问题,但也许也解决了其他问题,这些方法也与问题相关:
我只知道这些,祝你好运:)
https://stackoverflow.com/questions/70961915
复制相似问题