Python 模块安装太慢(pip 命令安装 、Pycharm 安装)

pip 安装出现的问题:

ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read
ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out

原因:由于pip命令默认安装源从外网下载,连接超时,
解决方案:直接修改pip安装镜像源
国内镜像源:
http://pypi.douban.com/ 豆瓣
http://pypi.hustunique.com/ 华中理工大学
http://pypi.sdutlinux.org/ 山东理工大学
http://pypi.mirrors.ustc.edu.cn/ 中国科学技术大学
例如:
pip install -i https://pypi.douban.com/simple <需要安装的包>
pip install -i https://pypi.douban.com/simple requests

**ERROR**: Could not install packages due to an EnvironmentError:
 [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/scipy-1.2.3.dist-info'Consider using the `--user` option or check the permissions.

解决方案:根据提示,系统权限不够,加--user参数
例如:pip install -i https://pypi.douban.com/simple scipy==1.2.3 --user

Pycharm中修改镜像源

FIle>Settings>Python Interpreter>点击+>Manage Repositories>点击+添加新的镜像源

第一步:


image.png

第二步:


image.png

第三步:
image.png

第四步:


image.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容