【发布时间】:2020-08-15 02:49:18
【问题描述】:
我正在尝试在带有 Ubuntu 的 Linux 的 Windows 子系统上配置 venv。
我尝试过的:
1) 安装venv 到pip(确切地说是pip3)
pip3 install venv
我收到以下错误
ERROR: Could not find a version that satisfies the requirement venv (from versions: none)
ERROR: No matching distribution found for venv
2) 安装venv 到apt 和apt-get
sudo apt install python3-venv
在这种情况下,安装似乎完成了,但是当我尝试使用 python3 -m venv ./venv 创建虚拟环境时,我收到一个错误,告诉我要执行 apt-get install python3-venv(我刚刚这样做了!)
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: ['/mnt/c/Users/Vicubso/.../code/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']
我还阅读了以下帖子 post 1, post 2 和其他几个。这些似乎都不能解决我的问题。
任何帮助将不胜感激。
【问题讨论】:
标签: python python-3.x ubuntu windows-subsystem-for-linux python-venv