Ale*_*akh 4 command-line python3 virtualenv
我已经安装virtualenv
:
pip3 install --user virtualenv
Run Code Online (Sandbox Code Playgroud)
然后我尝试使用下一个命令为我的文件夹创建一个环境:
folder_name$ python -m venv ll_env
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 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.__
Run Code Online (Sandbox Code Playgroud)
但是,尽管创建了virtualenv
名为thr 的错误文件夹ll_env
。
我不知道为什么会收到此错误。我是 Linux 新手。我尝试virtualenv
使用以下命令检查系统上是否存在:
pip3 show virtualenv
Run Code Online (Sandbox Code Playgroud)
我得到了:
Name: virtualenv
Version: 16.0.0
Summary: Virtual Python Environment builder
Home-page: https://virtualenv.pypa.io/
Author: Ian Bicking
Author-email: ianb@colorstudy.com
License: MIT
Location: /home/just_maverick/.local/lib/python3.6/site-packages
Requires:
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 python3-venv package using the following command.
apt-get install python3-venv
You may need to use sudo with that command.
Run Code Online (Sandbox Code Playgroud)
澄清一下,只需发出命令sudo apt-get install python-3-venv
或sudo apt install python-3-venv
其中任何一个即可安装python-3-venv 包,当然前提是您已先启用 Universe 存储库。
After installing the python3-venv package, recreate your virtual environment.__
Run Code Online (Sandbox Code Playgroud)
优秀的程序员通常会为可能发生的问题提供提示或直接的解决方案。这是后者的一个例子。