20171215 远端VPS的Ubuntu系统上如何安装python3.6 venv

 会有一个常见的坑-- 一不注意 就会犯错!!

https://askubuntu.com/questions/958303/unable-to-create-virtual-environment-with-python-3-6

4down votefavorite

I'm installed python 3.6 on my Ubuntu 17.04. Now, I'm trying to create virtual environment with command:

python3.6 -m venv env

but I'm getting the following message:

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/makeev/test2/l/bin/python3.6', '-Im', 'ensurepip', '--up


ince you specifically installedpython3.6instead of Ubuntu's default python3 version, which ispython3.5, you have to installpython3.6-venvinstead ofpython3-venvsince that would resolve topython3.5-venv.

To do so, you can use: sudo apt install python3.6-venv.


20171215 远端VPS的Ubuntu系统上如何安装python3.6 venv_第1张图片

你可能感兴趣的:(20171215 远端VPS的Ubuntu系统上如何安装python3.6 venv)