【Python】解决pip连接清华源超时问题的实用方法!
Replacing package opencv-contrib-python with opencv-contrib-python-headless
Looking in indexes: https://pypi.doubanio.com/simple, https://pypi.oystermercury.top/ms
Looking in links: https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html
pip install numba -i https://mirrors.aliyun.com/pypi/simple/
pip install numba -i https://pypi.org/simple
pip --default-timeout=100 install numba
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
确保 pip 和 setuptools 是最新版:
python -m pip install --upgrade pip setuptools
总结建议
优先尝试 更换镜像源(如阿里云)或 增加超时时间。如果问题仍然存在,可能是网络环境限制,需检查代理或防火墙设置。
按照这个路径找:HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings
ProxyEnable=0