[TOC]
sudo apt-get install python3-pip -y
# sudo apt-get install python2-pip -y
sudo mkdir ~/.pip
sudo cat << EOF > ~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
EOF
sudo pip3 install virtualenv
find ~/ -name virtualenv
/home/hxy/.local/bin/virtualenv
cat << EOF > ~/a
export PATH=$PATH:/home/hxy/.local/bin
EOF
virtualenv --python=/usr/bin/python3 py3
$ ls
bin include lib
cd py3
$ ls
bin include lib
$ cd bin/
$ ls
activate activate.ps1 easy_install pip3 python3 wheel
activate.csh activate_this.py easy_install-3.6 pip3.6 python3.6
activate.fish activate.xsh pip python python-config
# 激活
$ source activate
(py3) hxy@mghxy[18:17:43]:~/py3/bin
# 关闭
# 创建python系统默认的虚拟环境
virtualenv pyenv
# 创建python3虚拟环境
virtualenv --python=/usr/bin/python3 py3env
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。