升级3.4成3.6 ubuntu14.04 和miniconda虚拟环境
打开Anaconda Prompt窗口
conda update conda 先升级conda
激活要升级python的虚拟环境
conda install python=3.6.6 再升级python
conda create --name webapp python=3.6.6
conda remove --name webapp --all
ubunto14.04上自带python2.7和python3.4
要安装python3.4-venv执行sudo apt-get install python3.4-venv
先下载编译安装python3.6
#./configure --prefix=/usr/bin/python3.6 如果使用这个,需要自己创建一个软件链接ln -s /usr/bin/python3.6/bin/python3.6 /usr/bin/python36
./configure --prefix=/usr/bin
make && make install
这样执行python3 -m venv venv
就不会报Error Command: ['/home/wgetdj/WorkPlace/Programming/Python/myvenv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']
sudo apt-get install python3-venv
NOTE: On some versions of Debian/Ubuntu initiating the virtual environment like this currently gives the following error:
Error Command: ['/home/wgetdj/WorkPlace/Programming/Python/myvenv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']
To get around this, use the virtualenv command instead.
$ sudo apt-get install python-virtualenv
$ virtualenv --python=python3.6 myvenv
NOTE: If you get an error like
E: Unable to locate package python3-venv
then instead run:
sudo apt-get install python3.6-venv