Chinaunix首页 | 论坛 | 博客
  • 博客访问: 291021
  • 博文数量: 35
  • 博客积分: 825
  • 博客等级:
  • 技术积分: 913
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-11 09:44
文章分类

全部博文(35)

文章存档

2013年(10)

2012年(24)

2010年(1)

我的朋友

分类: Python/Ruby

2012-10-23 15:17:29

There are already lots of articles telling us why we need virtualenv to provide a separate environment(sandbox), such as different projects may depends on different libraries, or you don't have the write permission to the /path/to/python/site-packages directory.


I'm using pip to install virtualenv, it's pretty easy,

pip install virutalenv


then create an sandbox for my project, with the option --no-site-packages to isolate from main site-packages,

virutalenv --no-site-packages social-map


finally, i cloned my project directly into social-map. To active this environment,

source social-map/bin/active


if you want to deactive this environment, just type deactive. I don't know how to deactive the envrionment before, what i did was exit the terminator, then open a new one, very silly...


we can check the settings as `which python` etc. If you check the active script in ~/your/env/bin/, you can find this, virtual will change your path, and put the virtualenv's path at the beginning of the path, it will change your terminer's PS1 also.

VIRTUAL_ENV="/Users/pengphy/Codes/virtualenvs/social-map" PATH="$VIRTUAL_ENV/bin:$PATH"



阅读(1313) | 评论(0) | 转发(0) |
0

上一篇:用rpm管理python包

下一篇:python import

给主人留下些什么吧!~~