是的 ,听起来就是不靠谱,我估计如果你用 aliyun 的服务器,os 选择了 Ubuntu 16.04 ,什么也不装,因为默认带 python3,这个时候你想建立一个虚拟环境,
python3 -m venv .venv
你有可能得到这么一个错误
The virtual environment was not created successfully because ensurepip is notavailable. 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: ['/usr/bin/python3.5', '-Im', 'ensurepip', '--upgrade', '--default-pip']
系统都提示了,需要安装python3-venv ,
别着急,因为就算你装上了,还是同样的错误,这个bug和你的服务器的local 设定有关系
所以 下面才是正确的解决之道:
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales