pycharm 安装库

这是另一种方式。

搜索到的安装库的方式多数是:在桌面上win+R键运行终端,输入命令,安装不了,发现安装不了。

1、打开pycharm;

2、软件下部的Terminal终端(需要运行一个代码才能出现,任何代码都可);

3、有时候使用默认的官方网址下载安装包网速较慢,或者出现connection timeou报错。这时我们可以使用-i参数修改成从国内镜像下载安装。国内几个pip源网址如下:

清华: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/

4、安装命令:pip install 模块名 -i 国内源

其他安装命令:pip3 install 模块名(or + -i 国内源)

5、pip升级到7.0以后,在使用http镜像进行包安装及升级的时候往往会有如下提示:

Collecting beautifulsoup4

The repository located at xxx.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host xxx.com'.

这时候根据提示在最后添加--trusted-host + 镜像官网即可。

例如:

pip install 模块名 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

相关推荐
码路飞14 分钟前
写了个 AI 聊天页面,被 5 种流式格式折腾了一整天 😭
javascript·python
曲幽3 小时前
FastAPI压力测试实战:Locust模拟真实用户并发及优化建议
python·fastapi·web·locust·asyncio·test·uvicorn·workers
敏编程7 小时前
一天一个Python库:jsonschema - JSON 数据验证利器
python
前端付豪7 小时前
LangChain记忆:通过Memory记住上次的对话细节
人工智能·python·langchain
databook8 小时前
ManimCE v0.20.1 发布:LaTeX 渲染修复与动画稳定性提升
python·动效
花酒锄作田20 小时前
使用 pkgutil 实现动态插件系统
python
前端付豪1 天前
LangChain链 写一篇完美推文?用SequencialChain链接不同的组件
人工智能·python·langchain
曲幽1 天前
FastAPI实战:打造本地文生图接口,ollama+diffusers让AI绘画更听话
python·fastapi·web·cors·diffusers·lcm·ollama·dreamshaper8·txt2img
老赵全栈实战1 天前
Pydantic配置管理最佳实践(一)
python
阿尔的代码屋1 天前
[大模型实战 07] 基于 LlamaIndex ReAct 框架手搓全自动博客监控 Agent
人工智能·python