Python virtualenv 使用国内pip/easy_install创建虚拟环境

Virtualenv Docs

在使用Virtualenv创建虚拟开发环境时,经常因为网络原因,在安装Installing setuptools…… 和 Installing pip…… 时等待超时。

为解决此问题需要配置pip/easy_install国内pypi镜像。


pip Docs

    pip 配置文件中添加(不存在则创建)

        On Unix and Mac OS X the configuration file is:  $HOME/.pip/pip.conf 

            On Windows, the configuration file is:  %HOME%\pip\pip.ini

[global]
find-links=http://pypi.douban.com/simple
[instal]
find-links=
    http://pypi.douban.com/simple
    http://pypi.v2ex.com/simple


easy_install Docs

    easy_install 配置文件中添加(不存在则创建)   

            On Unix and Mac OS X the configuration file is:  $HOME/.pydistutils.cfg 

            On Windows, the configuration file is:  %HOME%\pydistutils.cfg

[easy_install]
index-url=http://pypi.douban.com/simple
find-links=
    http://pypi.douban.com/simple
    http://pypi.v2ex.com/simple


最后在运行virtualenv时加入 --extra-search-dir=SEARCH_PATH 选项,可以搜索本地site-package,加速setuptools安装。   

python virtualenv.py --extra-search-dir=/User/my/local/site-package/ <your_env_name>



转载于:https://my.oschina.net/dexterman/blog/214896

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值