Pycharm之配置python虚拟环境

最近给身边的人写了脚本,在自己电脑可以正常运行。分享给我身边的人,却运行不起来,然后把报错的截图给我看了,所以难道不会利用pycharm搭建虚拟的环境?记录一下配置的过程。

第一步:右键要打开的python的代码,选择Open Folder as Pycharm Project

第二步:配置本地的python环境

点击PyCharm工具栏上 File->Settings

第三步:选择 Project python_code --> Python Interpreter

会出现如下界面,点击 add Interpreter --> add local Interpreter

第四步:点击 虚拟的环境,

Environment: 选择 New, 在开发的时候,缺少什么包安装那些包

location: 本地虚拟venv的位置

Base interpreter: 本地python 的位置。

这些配置好了,选择OK。可以在Pycharm进行开发

第五步:配置好了如下图,只会存在基础三个包。

第六步:在PyCharm进行安装包或者在刚才配置python虚拟环境添加包。那种方便安装那种来

在PyCharm中 Terminal 中

进入环境

利用pip 进行安装需要的包。

创作不容易,若是觉得值,可以请博主喝杯coffee

相关推荐
花酒锄作田5 小时前
使用 pkgutil 实现动态插件系统
python
前端付豪8 小时前
LangChain链 写一篇完美推文?用SequencialChain链接不同的组件
人工智能·python·langchain
曲幽9 小时前
FastAPI实战:打造本地文生图接口,ollama+diffusers让AI绘画更听话
python·fastapi·web·cors·diffusers·lcm·ollama·dreamshaper8·txt2img
老赵全栈实战9 小时前
Pydantic配置管理最佳实践(一)
python
阿尔的代码屋15 小时前
[大模型实战 07] 基于 LlamaIndex ReAct 框架手搓全自动博客监控 Agent
人工智能·python
AI探索者1 天前
LangGraph StateGraph 实战:状态机聊天机器人构建指南
python
AI探索者1 天前
LangGraph 入门:构建带记忆功能的天气查询 Agent
python
FishCoderh1 天前
Python自动化办公实战:批量重命名文件,告别手动操作
python
躺平大鹅1 天前
Python函数入门详解(定义+调用+参数)
python
曲幽1 天前
我用FastAPI接ollama大模型,差点被asyncio整崩溃(附对话窗口实战)
python·fastapi·web·async·httpx·asyncio·ollama