我已经安装了virtualenv
:
pip3 install --user virtualenv
然后我尝试使用下一个命令为我的文件夹创建一个环境:
folder_name$ python -m venv ll_env
但是我并没有得到期望的结果,而是得到了一个错误:
__The virtual environment was not created successfully because ensurepip is not available.
On Debian/Ubuntu systems, you need to install 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.__
然而,尽管创建了错误virtualenv
文件夹ll_env
。
我不知道为什么会收到此错误。我是 Linux 新手。我尝试使用virtualenv
以下命令检查系统中是否存在:
pip3 show virtualenv
我得到了:
Name: virtualenv
Version: 16.0.0
Summary: Virtual Python Environment builder
Home-page: https://virtualenv.pypa.io/
Author: Ian Bicking
Author-email: [email protected]
License: MIT
Location: /home/just_maverick/.local/lib/python3.6/site-packages
Requires:
答案1
你这个问题的答案实际上是在你的问题:
__The virtual environment was not created successfully because ensurepip is not available.
On Debian/Ubuntu systems, you need to install python3-venv package using the following command.
apt-get install python3-venv
You may need to use sudo with that command.
为了澄清起见,只需发出命令sudo apt-get install python3-venv
或sudo apt install python3-venv
其中任何一个命令即可安装python3-venv 包,当然前提是你已经首先启用宇宙存储库。
After installing the python3-venv package, recreate your virtual environment.__
优秀的程序员经常会对可能出现的问题提供提示或直接的解决方案。这是后者的一个例子。