virtualenv 可以在系统中建立多个不同并且相互不干扰的虚拟环境。
python3的虚拟环境工具配置
1.下载虚拟环境工具
[root@localhost opt]#pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple virtualenv
[root@localhost opt]#find/opt/python-3.6.9-namesite-packages所有pip3安装的模块都会放在这里
[root@localhost opt]#virtualenv--no-site-packages--python=python3./ven1
[root@localhost opt]#virtualenv--python=python3./ven1
[root@localhost bin]#source /opt/venv1/bin/activate
[root@localhost opt]#pip3install django==1.11.9[root@localhost opt]#whichdjango-admin[root@localhost opt]#django-adminstartprojectvenv1_django119[root@localhost opt]#vimvenv1_django119/venv1_django119/settings.py设置允许访问[root@localhost opt]#python venv1_django119/manage.pyrunserver0.0.0.0:8080
[root@localhost opt]#pip3install django==2.0.1[root@localhost opt]#whichdjango-admin[root@localhost opt]#django-adminstartprojectvenv2_django201[root@localhost opt]#vimvenv2_django201/venv2_django201/settings.py设置允许访问[root@localhost opt]#python venv2_django201/manage.pyrunserver0.0.0.0:8081
virtualenv 可以在系统中建立多个不同并且相互不干扰的虚拟环境。
python3的虚拟环境工具配置
1.下载虚拟环境工具
[root@localhost opt]#pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple virtualenv
上一篇:【阅读悦己】2020年第2本笔记