Poetry 是 一个 Python 依赖管理和打包工具。 它允许您声明项目所依赖的库,并将为您管理(安装/更新)它们。
官网:
https://python-poetry.org/
Poetry 安装方法有三种:
- With the official installer
- With pipx
- With pip
官方推荐使用官方安装脚本,位于:
https://python-poetry.org/docs/。
注意: get-poetry.py 脚本将在 Poetry 1.2 中被 install-poetry.py 替代,建议直接使用最新版本的安装脚本。方法是在顶部的版本选择下拉框中选择 master。
官网默认的安装脚本仍然是get-poetry.py,在安装时过程中我注意到提示信息中含有如下提示:This installer is deprecated. Poetry versions installed using this script will not be able to use 'self update' command to upgrade to 1.2.0a1 or later.
这才注意到选择install-poetry.py更好。
安装
对于Windows操作系统,需要在PowerShell下输入
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
安装过程如下:
注意:由于服务器位于国外,安装过程很慢,建议科学上网。
This installer is deprecated. Poetry versions installed using this script will not be able to use 'self update' command to upgrade to 1.2.0a1 or later.
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located