码迷,mamicode.com
首页 > 编程语言 > 详细

【人生苦短,我学Python】个人学习笔记——设置pip和easy_install使用指定源

时间:2017-11-27 21:37:40      阅读:453      评论:0      收藏:0      [点我收藏+]

标签:使用   ack   imp   flow   dex   conf   localhost   eof   指定   

最近在学习编写 setup.py ,同时有一个内部pypi源,希望用内部源而不是默认源。
在stackoverflow搜索到了,贴过来备忘。

方法如下:

# Add the following to ~/.pydistutils.cfg for easy_install
[easy_install]
index_url = http://localhost:8000/


# Add the following to ~/.pip/pip.conf for pip
[global]
index-url = http://localhost:8000/

注:index_url 的值无需任何引号

将 index-url的值替换为所需的内部原地址即可,格式: http://${your_pip_server}/pypi/web/simple/

 

再多写个shell命令吧,以后用到就直接拷贝执行了:

# 这里假设服务器地址为  test.io
my_svr="test.io"

cat > ~/.pydistutils.cfg << EOF
[easy_install]
index-url = http://${my_svr}/pypi/web/simple/
EOF

mkdir -p ~/.pip/
cat > ~/.pip/pip.conf << EOF
[global]
index-url = http://${my_svr}/pypi/web/simple/
trusted-host = ${my_svr}
EOF

 

【人生苦短,我学Python】个人学习笔记——设置pip和easy_install使用指定源

标签:使用   ack   imp   flow   dex   conf   localhost   eof   指定   

原文地址:http://www.cnblogs.com/fwonfo/p/7905799.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!