PyCharm 安装库时显示连接超时

在setting->python Interpreter 中用"+" 安装库时,出现一个弹窗,提示信息如下:

复制代码
Error updating package list: Connect timed out

通过查阅资料,发现是镜像源的问题,具体的解决方案如下:

1. 更新一下pip版本

pip install --upgrade pip

2. 用pip安装库时加上源的地址

pip install 包名 -i https://pypi.tuna.tsinghua.edu.cn/simple/

我这里时安装的pandas库,所以我终端里输入的是:

pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple/

运行结果如下:

此时pandas库已经安装成功了! !终于解决了!!!我还以为是http 代理的问题(我是设置了不使用代理),但其实并不是,我修改完之后没什么用。。

注:

清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里:http://mirrors.aliyun.com/pypi/simple/

豆瓣:http://pypi.douban.com/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/

中国科学技术大学:http://pypi.mirrors.ustc.edu.cn/

感谢大家的关注与支持~

相关推荐
明月_清风2 小时前
Python 内存手术刀:sys.getrefcount 与引用计数的生死时速
后端·python
明月_清风2 小时前
Python 消失的内存:为什么 list=[] 是新手最容易踩的“毒苹果”?
后端·python
Flittly17 小时前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(3)TodoWrite (待办写入)
python·agent
千寻girling21 小时前
一份不可多得的 《 Django 》 零基础入门教程
后端·python·面试
databook1 天前
探索视觉的边界:用 Manim 重现有趣的知觉错觉
python·动效
明月_清风1 天前
Python 性能微观世界:列表推导式 vs for 循环
后端·python
明月_清风1 天前
Python 性能翻身仗:从 O(n) 到 O(1) 的工程实践
后端·python
helloweilei2 天前
python 抽象基类
python
用户8356290780512 天前
Python 实现 PPT 转 HTML
后端·python
zone77392 天前
004:RAG 入门-LangChain读取PDF
后端·python·面试