尽管正确地安装了所需的dev库和venv,但我还是得到了这些连续错误。
这是终端中的连续输出。
~/Desktop/virtualenvs$ python3.8 -m venv newpy38
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt-get install python3-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
Failing command: ['/home/dji/Desktop/virtualenvs/newpy38/bin/python3.8', '-Im', 'ensurepip', '--upgrade', '--default-pip']当我运行sudo时,要确定我已经安装了venv库。
~/Desktop/virtualenvs$ sudo apt-get install python3-venv
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-venv is already the newest version (3.6.7-1~18.04).
0 upgraded, 0 newly installed, 0 to remove and 458 not upgraded.当我运行sudo时,再次确定我安装了venv库。
~/Desktop/virtualenvs$ sudo apt-get install python3.8-venv
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3.8-venv is already the newest version (3.8.0-3~18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 458 not upgraded.我也尝试了以下链接,但没有结果:
===更新===在某种程度上,卸载和重新安装===解决了这个venv问题。我也不知道为什么。
发布于 2021-11-08 06:25:25
原来这是因为一个坏了的蟒蛇安装!由于sudo apt-get update sudo apt-get autoremove的使用很差(而且不小心),我最终导致python安装中断,无法正确找到其已安装的库。
我重新安装了python,现在可以了。
额外注意:由于我在嵌入式计算机(dji manifold2g)上使用这个选项,一些用户可能无法轻松地重新安装python。重新刷新整个固件(它与python一起预装)实际上可能会更有帮助,尽管更不方便。
https://stackoverflow.com/questions/69794361
复制相似问题