因提供的默认镜像无法访问,故下载时可指定镜像下载:
pip install confluence -i https://pypi.douban.com/simple
修改镜像长久生效的方式:
通过命令行快速配置
- 打开
PowerShell或CMD
右键开始菜单 → 选择 “Windows PowerShell” 或 “命令提示符” - 执行配置命令
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn
- 验证配置
pip config list
应显示:
global.index-url='https://pypi.tuna.tsinghua.edu.cn/simple'
global.trusted-host='pypi.tuna.tsinghua.edu.cn'
手动创建配置文件
- 创建配置文件路径
按下 Win + R → 输入%USERPROFILE%→ 回车
新建文件夹 → 命名为 “pip”
进入 pip 文件夹 → 新建文本文档 → 重命名为 "pip.ini"这里是引用
- 编辑 pip.ini 文件
右键用记事本打开,输入以下内容:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
timeout = 6000
- 保存文件
确保文件保存为无 BOM 的 UTF-8 编码格式
(记事本保存时选择 “另存为” → 编码选择 “UTF-8”)
验证配置生效
pip install -v numpy使用命令观察下载地址是否来着镜像站
常用镜像源替换列表
| 镜像名称 | 替换内容 |
|---|---|
| 清华大学 | https://pypi.tuna.tsinghua.edu.cn/simple |
| | 阿里云 |
| 腾讯云 | https://mirrors.cloud.tencent.com/pypi/simple |
| | 华为云 |
| 豆瓣源 | https://pypi.doubanio.com/simple |
940

被折叠的 条评论
为什么被折叠?



