最近用pip安装pandas失败,提示如下:
Could not find a version that satisfies the requirement pandas (from versions: )
发现问题出在无法连接到Python库,因为pip和conda的安装都是默认国外站点,故可通过配置国内镜像来搞定:
# 配置清华PyPI镜像(如无法运行,将pip版本升级到>=10.0.0)
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
随后重新pip install pandas
安装成功。
如果需要取消镜像设置,可以
pip config unset global.index-url
当然也可以选择其他镜像站点,之后整理出来会在这里分享。