Python pip建立pip.ini 修改为Aliyun源下载三方模块
2021-06-14 17:03
标签:environ sim col install file profile url global tps Python pip建立pip.ini 修改为Aliyun源下载三方模块 标签:environ sim col install file profile url global tps 原文地址:https://www.cnblogs.com/tingguoguoyo/p/12823378.html 1 """
2 python建立pip.ini Aliyun源
3 2020年5月3日20:28:50 Venti Fang
4 """
5
6 import os
7
8 ini = """
9 [global]
10 index-url = https://mirrors.aliyun.com/simple/
11 [install]
12 trusted-host=mirrors.aliyun.com
13 """
14 pippath = os.environ["USERPROFILE"] + "\\pip\\" #C:\Users\84788\pip\
15 # print(pippath)
16 if not os.path.exists(pippath):
17 os.mkdir(pippath)
18
19 with open(pippath + "pip.ini", "w+") as f:
20 f.write(ini)
文章标题:Python pip建立pip.ini 修改为Aliyun源下载三方模块
文章链接:http://soscw.com/index.php/essay/93957.html