由于requirement众所周知的缺陷,现在官方使用基于
pyproject.toml的配置来配置一个项目环境。uv提供了众多官方命令的封装,加速开发,简化管理。
curl -LsSf <https://astral.sh/uv/install.sh> | sh
# macOS / Linux
curl -LsSf <https://gitee.com/wangnov/uv-custom/releases/download/0.9.22/uv-installer-custom.sh> | sh
echo 'eval "$(uv generate-shell-completion zsh)"' >> ~/.zshrc
其他安装途径见doc
uv init --python 3.12uv add: Add a dependency to the project.
uv remove: Remove a dependency from the project.uv syncuv pip install : 将包安装到当前环境。uv runuv tree