110 字
1 分钟
Poetry:Python包管理工具实用指南
Resources
Install
curl -sSL https://install.python-poetry.org | python3 -Config
Config file location
- macOS:
~/Library/Application Support/pypoetry - Windows:
%APPDATA%\pypoetry - Unix:
~/.config/pypoetry
project env
poetry config virtualenvs.in-project true这样poetry就会在项目目录下建立虚拟环境文件夹.venv
Common commands
# 初始化poetry init# 指定虚拟环境python版本poetry env use python3.11# 配置镜像源poetry source add --priority=primary mirrors https://pypi.tuna.tsinghua.edu.cn/simple/# 安装所有依赖,--no-root不会安装项目本身poetry install --no-root# 添加python包poetry add xxxx# 添加开发环境的python包poetry add xxxx -G dev Poetry:Python包管理工具实用指南
https://lordhamster.com/posts/poetry/ 评论