Linux/Mac下pip换源

来源:互联网 发布:cs6软件下载 编辑:程序博客网 时间:2024/06/03 15:38

任意文件夹下新建个xxx.sh,把下面的内容敲进去

#!/bin/bashecho "pip换源"cd ~dir=".pip"[ -d "$dir" ] && rm -rf "$dir"mkdir "$dir"cat>"$dir"/pip.conf<<EOF[global]index-url = http://mirrors.aliyun.com/pypi/simple/[install]trusted-host=mirrors.aliyun.comEOF

然后运行

sh ./xxx.sh

就行了