python Virtual Environments
Install
$ pip install virtualenv
Basic usage
- 在一个项目中创建一个虚拟环境
$ cd my_project_folder
$ virtualenv venv
也可以创建一个指定python版本解释器的虚拟环境
$ virtualenv -p /usr/bin/python2.7 venv
- 开始使用之前需要先激活
$ source venv/bin/activate
- 如果完成工作后需要取消激活,返回系统默认的python解释器环境.
$ deactivate
其他要点
执行virtualenv --no-site-packages将不会将系统安装的包复制到虚拟环境中
如果需要保证环境的一致性,最好的办法就是冻结当前环境的包配置
$ pip freeze > requirements.txt
这将会创建一个requirements.txt的文件,里面包含一个当前环境安装包的列表,使用下面的语句可以还原安装配置:
$ pip install -r requirements.txt
python Virtual Environments的更多相关文章
- [Python] Manage Dependencies with Python Virtual Environments
Virtual Environments ensure that dependencies from one Python application don’t overwrite the depend ...
- [译]The Python Tutorial#12. Virtual Environments and Packages
[译]The Python Tutorial#Virtual Environments and Packages 12.1 Introduction Python应用经常使用不属于标准库的包和模块.应 ...
- Virtual Environments for mac
A Virtual Environment is a tool to keep the dependencies required by different projects in separate ...
- Networked Graphics: Building Networked Games and Virtual Environments (Anthony Steed / Manuel Fradinho Oliveira 著)
PART I GROUNDWORK CHAPTER 1 Introduction CHAPTER 2 One on One (101) CHAPTER 3 Overview of the Intern ...
- Converting Python Virtual Machine Code to C
Converting Python Virtual Machine Code to C
- Virtual Environments
virtualenv 再另一篇随笔中已经提到过virtualenv.如果我们有好几个不同的项目,他们需要的第三方包版本不同,那怎么办呢.这时候就需要virtualenv创建一个虚拟环境,里面包含了一个 ...
- python virtual env 使用 jupyter ipython notebook,舒服了, 工作效率翻倍
话不多说,尊重原作者 知乎链接
- [python] python django web 开发 —— 15分钟送到会用(只能送你到这了)
1.安装python环境 1.1 安装python包管理器: wget https://bootstrap.pypa.io/get-pip.py sudo python get-pip.py 1. ...
- python中的PEP是什么?怎么理解?(转)
PEP是什么? PEP的全称是Python Enhancement Proposals,其中Enhancement是增强改进的意思,Proposals则可译为提案或建议书,所以合起来,比较常见的翻译是 ...
随机推荐
- jshint错误
这条命令即可. npm install --save-dev jshint gulp-jshint
- 微信小程序自定义分享图片
自定义分享图片 onShareAppMessage: (res) => { if (res.from === 'button') { console.log("来自页面内转发按钮&qu ...
- 《The Story of My Life》Introductiom - A Journey Of Discovery
"I do not object to harsh criticism," said Helen Keller, "so long as I am treated lik ...
- 中小型研发团队架构实践:分布式协调服务ZooKeeper
一.ZooKeeper 是什么 Apache ZooKeeper 由 Apache Hadoop 的子项目发展而来,于 2010 年 11 月正式成为了 Apache 的顶级项目. 相关厂商内容 优秀 ...
- NOJ 1012 进制转换(十进制转换成随意进制)
题目: 进制转换 时间限制(普通/Java) : 1000 MS/ 3000 MS 执行内存限制 : 65536 KByte总提交 : 1819 測试通过 : ...
- ASDASASD
测试 markdown 随笔 asdsdf sdf
- 要练习的lambda
取list的id 放入新List<Integer> List<Integer> list1 = list.stream().map(albumGroup1 -> albu ...
- unity5, animator state machine, 无条件transition实现播放动画序列
今天遇到这样一个需求,我有一个名为happy的animation clip和一个名为speak的animation clip.想实现当主角胜利后播放动序列: happy->speak->h ...
- spring boot下WebSocket消息推送(转)
原文地址:https://www.cnblogs.com/betterboyz/p/8669879.html WebSocket协议 WebSocket是一种在单个TCP连接上进行全双工通讯的协议.W ...
- springboot页面缓存和url缓存实例
@Autowired RedisService redisService; @Autowired GoodsService goodsService; @Autowired ThymeleafView ...