我正在尝试配置venv
在带有 Ubuntu 的 Linux 的 Windows 子系统上。
我尝试过的:
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
and 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 https://stackoverflow.com/questions/34271982/install-python3-venv-module-on-linux-mint,
post 2 https://stackoverflow.com/questions/37390827/install-venv-for-python3,以及其他几个。这些似乎都不能解决我的问题。
任何帮助将非常感激。