kikaylee 2020-05-03
""" python建立pip.ini Aliyun源 2020年5月3日20:28:50 Venti Fang """ import os ini = """ [global] index-url = https://mirrors.aliyun.com/simple/ [install] trusted-host=mirrors.aliyun.com """ pippath = os.environ["USERPROFILE"] + "\\pip\\" #C:\Users\84788\pip\ # print(pippath) if not os.path.exists(pippath): os.mkdir(pippath) with open(pippath + "pip.ini", "w+") as f: f.write(ini)