-- 包管理工具 nv
uv
用途
- python 版本管理
- 脚本运行
- 初始化项目
- 项目依赖管理
应用安装方式
win 上:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Mac 或 Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# 或者是
wget -qO- https://astral.sh/uv/install.sh | sh
版本管理
uv python install 3.12安装 python 版本uv python list查看可用的 python 版本uv python uninstall移除指定版本的 python
项目管理
使用 pyproject.toml 创建以及运行项目
uv run运行脚本uv init初始化项目uv add添加依赖uv remove移除依赖uv sync使用 environment 同步项目依赖uv lock为依赖创建一个 lock file