在c:user(或者用户)电脑的用户名,目录下创建一个命名为“pip”的文件夹(如:C:UsersAdministratorpip),在该文件夹下创建一个命名为“pip.ini”的文件,在该文件中写入以下内容:
[global] index-url=https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host=pypi.tuna.tsinghua.edu.cn disable-pip-version-check = true timeout = 6000
若是想在安装package的时候再设置源,可以以这种方式来进行,以TensorFlow为例,个人修改为自己的包名:
pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple



