安装poetry

系统安装poetry

Linux:
curl -sSL https://install.python-poetry.org | python3 - 安装
Windows:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
在这里插入图片描述poetry --version 验证安装是否成功
在这里插入图片描述

迁移poetry项目

项目安装poetry

poetry env use python3.11 设置虚拟环境
poetry install install 命令从当前项目中读取 pyproject.toml 文件,解析依赖项并安装它们。
在这里插入图片描述

Vscode配置 对应虚拟环境的interpreter

terminal输入poetry shell,得到poetry的路径

. /home/用户名/.cache/pypoetry/virtualenvs/rag-utils-re8bqiF8-py3.11/bin/activate

interpreter配置编译器位置:

. /home/用户名/.cache/pypoetry/virtualenvs/rag-utils-re8bqiF8-py3.11/bin/你的python版本

安装依赖

poetry install

初始化poetry项目

poetry init
在这里插入图片描述
你会发现目录中生成了pyproject.toml文件
在这里插入图片描述

poetry install
在这里插入图片描述

你会发现目录中生成了poetry.lock文件在这里插入图片描述

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐