python pip 下载慢
1. 使用国内镜像源安装(推荐)
清华大学镜像:
pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple
阿里云镜像:
pip install pandas -i https://mirrors.aliyun.com/pypi/simple/
豆瓣镜像:
pip install pandas -i https://pypi.doubanio.com/simple/
2. 永久设置镜像源(可选)
避免每次都需要指定镜像源,设置后,后续所有 pip install 命令都会使用清华镜像源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
如果仍然缓慢,尝试这些方法
添加超时参数:
pip --default-timeout=100 install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple
仅下载不安装(手动安装):
pip install pandas-2.3.0-cp313-cp313-win_amd64.whl
使用缓存优先(如果之前下载过):
pip install pandas --no-cache-dir
3. 安装完成后验证
python -c “import pandas as pd; print(f’成功安装 pandas 版本: {pd.version}')”
输出:
成功安装 pandas 版本: 2.3.0