Python虚拟环境库virtualenvwrapper安装及使用
作者:吞风吻雨ii 时间:2023-12-28 22:11:53
virtualenvwrapper是用来管理virtualenv的扩展包,用着很方便。
1. 安装:
#安装virtualenvwrapper
$ pip install virtualenvwrapper
#windows
pip install virtualenvwrapper-win
2.修改mkvirtualenv的默认路径
Linux:
安装完成后,在~/.bash_profile写入以下内容
export PATH
export WORKON_HOME=~/Envs
export VIRTUALENVWRAPPER_PYTHON=/bin/python3.6
source /bin/virtualenvwrapper.sh
第一行:virtualenvwrapper存放虚拟环境目录
第二行:virtrualenvwrapper会安装到python的bin目录下,所以该路径是python安装目录下bin/virtualenvwrapper.sh
source ~/.bash_profile#读入配置文件,立即生效
Windows:
修改环境变量:
1.打开控制面板-系统和安全-系统-高级系统设置-环境变量-系统变量-点击新建,
2.变量名:输入WORKON_HOME, 变量值:输入自定义的路径,确定保存即可
3.进入python的安装路径,我这里是C:\Program Files\python36\Scripts下,具体根据自己的安装路径
4.双击virtualenvwrapper.bat
5.重新打开cmd命令行窗口,即可使用
3. 用法:
mkvirtualenv [name]:创建运行环境
workon [name]: 工作在 [name] 环境 或 从其它环境切换到 [name] 环境
deactivate: 退出终端环境
rmvirtualenv ENV:删除运行环境ENV
lsvirtualenv: 列出所有的虚拟环境
cdvirtualenv:进入到虚拟环境所在的目录lssitepackages: 列出当前环境安装了的包
来源:https://www.cnblogs.com/LMIx/p/10767307.html
标签:Python,虚拟,环境,库,virtualenvwrapper
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python Series从0开始索引的方法
2021-07-17 19:20:38
python3 pathlib库Path类方法总结
2022-06-10 18:38:11
Python标准库json模块和pickle模块使用详解
2021-12-24 16:17:14
实例讲解如何配置MySQL数据库主从复制
2008-12-17 15:33:00
用ReactJS和Python的Flask框架编写留言板的代码示例
2021-09-29 07:33:14
php基础字符串与数组知识点讲解
2023-05-25 08:28:14
利用python/R语言绘制圣诞树实例代码
2021-02-10 02:32:23
![](https://img.aspxhome.com/file/2023/5/93715_0s.png)
Python使用dict.fromkeys()快速生成一个字典示例
2022-05-10 08:13:23
jupyter notebook 调用环境中的Keras或者pytorch教程
2022-10-07 23:23:09
![](https://img.aspxhome.com/file/2023/5/92525_0s.jpg)
详解Python如何实现发送带附件的电子邮件
2022-03-20 13:33:46
![](https://img.aspxhome.com/file/2023/2/64742_0s.png)
MySQL数值类型溢出的处理方法
2024-01-19 12:03:34
python利用pandas将excel文件转换为txt文件的方法
2022-04-05 18:49:01
Go http client 连接池不复用的问题
2024-02-03 05:17:15
Go语言基础设计模式之策略模式示例详解
2024-05-25 15:11:01
![](https://img.aspxhome.com/file/2023/7/123957_0s.png)
vs code开发中语法正确但显示报错问题分析解决
2023-08-05 11:54:26
![](https://img.aspxhome.com/file/2023/7/132427_0s.png)
设计与用户体验
2009-05-06 13:36:00
![](https://img.aspxhome.com/file/UploadPic/20095/6/youshang02-88s.png)
Pandas时间序列重采样(resample)方法中closed、label的作用详解
2023-01-31 17:46:36
JavaScript的9个陷阱及评点
2007-08-28 15:10:00
实操Python爬取觅知网素材图片示例
2021-12-12 21:19:59
![](https://img.aspxhome.com/file/2023/3/109923_0s.jpg)
matplotlib.pyplot.matshow 矩阵可视化实例
2022-01-04 02:57:21
![](https://img.aspxhome.com/file/2023/6/92006_0s.jpg)