现象

“python -m pip install matplotlib”

安装 matplotlib,无法下载完成,提示有其他进程正在使用或其他错误原因。

原因

默认使用 “https://pypi.org/simple/” 作为安装数据源,从国内访问这个数据源不算稳定,本质上会发生网络超时。

解决办法

不使用默认数据源,指定使用国内一些机构提供的镜像数据源。

中国科技大学提供的镜像数据源:Simple Indexhttps://mirrors.ustc.edu.cn/pypi/simple/清华大学提供的镜像数据源:Simple Indexhttps://pypi.tuna.tsinghua.edu.cn/simple

“python -m pip install --index https://pypi.tuna.tsinghua.edu.cn/simple matplotlib”,快速、成功安装。(安装其他如 plotly、pandas 同理,替换 ‘matplotlib’ 即可)

【清华大学提供的镜像数据源,内容同步更快、更完善】

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐