我几天前从ubuntu 14.04升级到ubuntu 16.04.当我尝试使用创建虚拟环境时
pyvenv .venv
Run Code Online (Sandbox Code Playgroud)
要么
python3 -m venv .venv
Run Code Online (Sandbox Code Playgroud)
有一个错误:
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: ['/usr/bin/python3.5', '-Im', 'ensurepip', '--upgrade', '--default-pip']
Run Code Online (Sandbox Code Playgroud)
我试过跑两个
sudo apt-get install python3-venv
Run Code Online (Sandbox Code Playgroud)
和
sudo apt-get install python3.5-venv
Run Code Online (Sandbox Code Playgroud)
但它没有解决我的问题.
有人可以帮忙吗?谢谢
我已经deadsnakes在我的 Ubuntu 20.04 机器上安装了 Python 3.10。
如何使用它?python3 --version返回Python 3.8.10并python3.10 -m venv venv返回错误(我python3-venv也安装了)。
我想创建一个将 python3.8 作为 python3 的 venv 在 Ubuntu 18.04 上我做了:
> sudo apt install python3.8 python3.8-venv
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试:
> python3.8 -m venv env
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/pushp/vizio-backend/env/bin/python3.8', '-Im', 'ensurepip', '--upgrade', '--default-pip']
Run Code Online (Sandbox Code Playgroud)
我的应用程序依赖于 python3.8。我在这里缺少什么?
我在个人仓库上做了一些 python leetcode,在我将 Kubuntu 升级到 22.04 后,我意识到当前的 venv 不起作用。
我想我需要重新创建 venv。安装了 python3.10-venv 但我无法获取并激活它。
事实上 venv/bin/activate 已经不存在了。
该文件夹仅包含三个文件
python python3 python3.10
Run Code Online (Sandbox Code Playgroud)
我试过了,但没有骰子
source venv/bin/python3.10
Run Code Online (Sandbox Code Playgroud)
所以自然 source venv/bin/activate 不起作用。有想法吗?