Created
June 16, 2016 08:59
-
-
Save DeronW/b4899a10e7da13412faa4c7f3e802444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
python建立pip.ini | |
使用国内的 豆瓣 作为安装源 加速安装过程 | |
""" | |
import os | |
ini="""[global] | |
index-url = https://pypi.doubanio.com/simple/ | |
[install] | |
trusted-host=pypi.doubanio.com | |
""" | |
pippath=os.environ["USERPROFILE"]+"\\pip\\" | |
if not os.path.exists(pippath): | |
os.mkdir(pippath) | |
with open(pippath+"pip.ini","w+") as f: | |
f.write(ini) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment