当前位置:网站首页>用virtualenv和Virtualenvwrapper虚拟环境管理工具创建虚拟环境
用virtualenv和Virtualenvwrapper虚拟环境管理工具创建虚拟环境
2022-08-01 22:32:00 【纬领网络】
一、使用virtualenv
1.安装virtualenv
pip install -i https://pypi.douban.com/simple/ --trusted-host pypi.douban.com virtualenv2.创建运行环境
virtualenv [虚拟环境名称]
virtualenv venv
#如果不想使用系统的包,加上–no-site-packeages参数
virtualenv --no-site-packages 创建路径名3.激活环境
linux下
$ source ./bin/activatewindows下
.\Scripts\activate.bat4.退出环境
deactivate
5.删除环境
可以直接删除venv文件夹来删除环境
二、使用Virtualenvwrapper
Virtaulenvwrapper是virtualenv的扩展包,用于更方便管理虚拟环境,它可以做: - 将所有虚拟环境整合在一个目录下 - 管理(新增,删除,复制)虚拟环境 - 快速切换虚拟环境
1.安装
# Windows 下
pip install virtualenvwrapper-win
# macOS / Linux 下
pip install --user virtualenvwrapper
# 加载环境变量
echo "source virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc2.创建虚拟环境
# macOS/Linux 下
mkvirtualenv --python=python3.6 venv
# Windows 下
mkvirtualenv --python=python3 venv3.激活虚拟环境
workon #列出虚拟环境列表
workon [venv] #切换环境4.退出环境
deactivate5.删除环境
rmvirtualenv venv边栏推荐
猜你喜欢

2022 版 MySQL 巅峰教程,收藏好,慢慢看

求解多元多次方程解的个数

xctf攻防世界 Web高手进阶区 webshell

移动端人脸风格化技术的应用

华为无线设备配置双链路冷备份(AP指定配置方式)

JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method

Advanced Algebra_Proof_The algebraic multiplicity of any eigenvalue of a matrix is greater than or equal to its geometric multiplicity

Postman batch test interface detailed tutorial

APP专项测试:流量测试

使用Jenkins做持续集成,这个知识点必须要掌握
随机推荐
Go 微服务开发框架DMicro的设计思路
【C补充】链表专题 - 单向链表
字符串——Trie
long investment career
APP special test: traffic test
感觉自己好傻
Use Jenkins for continuous integration, this knowledge point must be mastered
Wechat Gymnasium Appointment Mini Program Graduation Design Finished Work (4) Opening Report
小程序毕设作品之微信体育馆预约小程序毕业设计成品(1)开发概要
解决 win10 下 ISE14.7的 iMPACT 崩溃问题 - FPGA 笔记
Deep Learning Course2 Week 2 Optimization Algorithms Exercises
String - Trie
SOM Network 1: Principles Explained
熟悉的朋友
xctf attack and defense world web master advanced area web2
Today's sleep quality record 74 points
PHP算法之电话号码的字母组合
Advanced Algebra_Proof_The algebraic multiplicity of any eigenvalue of a matrix is greater than or equal to its geometric multiplicity
SOM Network 2: Implementation of the Code
SAP Spartacus NgExpressEngineDecorator 的工作原理