Ubuntu 安装virtualenv
[TOC]
Ubuntu 安装virtualenv
一、安装pip
1、安装pip
sudo apt-get install python3-pip -y # sudo apt-get install python2-pip -y
2、配置pip源
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
二、安装virtualenv
1、安装virtualenv
sudo pip3 install virtualenv
2、配置virtualenv环境
find ~/ -name virtualenv /home/hxy/.local/bin/virtualenv cat << EOF > ~/a export PATH=$PATH:/home/hxy/.local/bin EOF
三、配置virtualenv环境
1、创建虚拟环境
virtualenv --python=/usr/bin/python3 py3 $ ls bin include lib
2、激活使用环境
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) [18:17:43]:~/py3/bin # 关闭
3、相关命令
# 创建python系统默认的虚拟环境 virtualenv pyenv # 创建python3虚拟环境 virtualenv --python=/usr/bin/python3 py3env
相关推荐
JakobHu 2020-05-27
宿舍 2020-05-15
jacktangj 2020-08-20
D先生 2020-06-28
fengzhiwu 2020-06-10
txlCandy 2020-06-09
fengzhiwu 2020-06-07
sunny0 2020-06-01
sesiria 2020-05-31
huavhuahua 2020-05-28
bcbeer 2020-05-15
小火车 2020-05-07
fendou00sd 2020-05-09
周小董 2020-05-06
zhangwentaohh 2020-05-04
坚持是一种品质 2020-04-15
葫芦小金刚 2020-03-12
zhuquan0 2020-03-02