Python 官方文档:入门教程 => 点击学习
方法1:(永久更改) 在python的命令提示符中运行以下语句,该条语句将pip的下载源永久更改为某个镜像站,这里以清华大学开源镜像站为例: pip config set global.index-u
在python的命令提示符中运行以下语句,该条语句将pip的下载源永久更改为某个镜像站,这里以清华大学开源镜像站为例:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
windows环境下,在用户目录中创建一个文件夹,该文件夹的命名为pip;在该pip文件夹中新建一个文件pip.ini,pip.ini的内容如下:(完整路径:C:\Users\用户名\pip\pip.ini)
[global]index-url=Https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host=pypi.tuna.tsinghua.edu.cndisable-pip-version-check = true timeout = 6000
在安装库的时候,临时需要用到某个镜像,这里以清华大学镜像为例下载pandas库:
pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple/
豆瓣:http://pypi.douban.com/simple/阿里云:http://mirrors.aliyun.com/pypi/simple/华为云:https://repo.huaweicloud.com/repository/pypi/simple清华大学:https://pypi.tuna.tsinghua.edu.cn/simple中科大:https://pypi.mirrors.ustc.edu.cn/simple/
来源地址:https://blog.csdn.net/Castle_520/article/details/127548410
--结束END--
本文标题: python更换国内镜像源
本文链接: https://www.lsjlt.com/news/391876.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0