153 字
1 分钟
UV:Rust编写的Python神器安装配置与使用技巧
An extremely fast Python package and project manager, written in Rust.
Resources
Install
curl -LsSf https://astral.sh/uv/install.sh | shUpdate
uv self update国内加速
export UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simpleInstall Python
uv python install 3.13Usage
# Create a new Python project in the current directory:uv init
# Create a new Python project in a directory with the given name:uv init project_name
# Create a environmentuv venv -p 3.13
# Add a new package to the project:uv add package
# Remove a package from the project:uv remove package
# Add a new dev package to the project:uv add --dev package
# Run a script in the project's environment:uv run path/to/script.py
# Run a command in the project's environment:uv run command
# Update a project's environment from pyproject.toml:uv sync
# Create a lock file for the project's dependencies:uv lock
# Export the project's dependencies to a requirements.txt file:uv pip freeze > requirements.txt UV:Rust编写的Python神器安装配置与使用技巧
https://lordhamster.com/posts/uv/ 评论