問題描述
每當(dāng)我嘗試安裝軟件包時,例如 pip3 install PyQt5
,該命令都會失敗,并顯示有關(guān) /tmp
目錄中缺少目錄的消息
Whenever I try to install a package, for example pip3 install PyQt5
the command fails with a message about a missing directory in the /tmp
directory
pip3 install PyQt5
Collecting PyQt5
Downloading https://files.pythonhosted.org/packages/3a/fb/eb51731f2dc7c22d8e1a63ba88fb702727b324c6352183a32f27f73b8116/PyQt5-5.14.1.tar.gz (3.2MB)
100% |████████████████████████████████| 3.2MB 19.3MB/s
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.7/tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-0shdy0kn/PyQt5/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-0shdy0kn/PyQt5/
當(dāng)我查看 /tmp
目錄時,不存在 pip-install-xxxxxxx
目錄,并且看起來進程根本沒有創(chuàng)建它們.
When I look in the /tmp
directory no pip-install-xxxxxxx
directories exist and it looks like the process doesn't create them at all.
推薦答案
作為快速修復(fù),您可以 sudo apt-get install python3-pyqt5
As a quick fix you can sudo apt-get install python3-pyqt5
但是為了你的問題.任何包裹都會發(fā)生這種情況嗎?
But for the sake of your question. Does this happen with any package?
您可以嘗試安裝以下任何一個來看看它是否有效,這些只是簡單的示例.
Can you try installing any of the following just to see if it works, these are just quick examples.
pip3 install numpy==1.18.1
pip3 install pandas==0.25.3
pip3 install pep8==1.7.1
pip3 install pika==1.1.0
一個原因可能是 PyQt5
將與 python 2
一起使用,因此可能僅適用于 pip install PyQt5
One reason could be that PyQt5
is to be used with python 2
and hence might only work with pip install PyQt5
這篇關(guān)于pip3安裝命令重復(fù)創(chuàng)建文件'/tmp/pip-install-xxxxx/package'失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!