当前位置: 首页 > news >正文

Tool-Python package and project manager-uv

Tool-Python package and project manager-uv

  • Home
  • GitHub Releases

An extremely fast Python package and project manager, written in Rust.

Install uv with our official standalone installer:

  • Linux/macOS:curl -LsSf https://astral.sh/uv/install.sh | sh
  • Windows:powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
~$ uv
An extremely fast Python package manager.Usage: uv [OPTIONS] <COMMAND>Commands:auth       Manage authenticationrun        Run a command or scriptinit       Create a new projectadd        Add dependencies to the projectremove     Remove dependencies from the projectversion    Read or update the project's versionsync       Update the project's environmentlock       Update the project's lockfileexport     Export the project's lockfile to an alternate formattree       Display the project's dependency treeformat     Format Python code in the projectaudit      Audit the project's dependenciestool       Run and install commands provided by Python packagespython     Manage Python versions and installationspip        Manage Python packages with a pip-compatible interfacevenv       Create a virtual environmentbuild      Build Python packages into source distributions and wheelspublish    Upload distributions to an indexworkspace  Inspect uv workspacescache      Manage uv's cacheself       Manage the uv executablehelp       Display documentation for a commandCache options:-n, --no-cache               Avoid reading from or writing to the cache,instead using a temporary directory for theduration of the operation [env: UV_NO_CACHE=]--cache-dir <CACHE_DIR>  Path to the cache directory [env: UV_CACHE_DIR=]Python options:--managed-python       Require use of uv-managed Python versions [env:UV_MANAGED_PYTHON=]--no-managed-python    Disable use of uv-managed Python versions [env:UV_NO_MANAGED_PYTHON=]--no-python-downloads  Disable automatic downloads of Python. [env:"UV_PYTHON_DOWNLOADS=never"]Global options:-q, --quiet...Use quiet output-v, --verbose...Use verbose output--color <COLOR_CHOICE>Control the use of color in output [possible values: auto, always,never]--system-certsWhether to load TLS certificates from the platform's nativecertificate store [env: UV_SYSTEM_CERTS=]--offlineDisable network access [env: UV_OFFLINE=]--allow-insecure-host <ALLOW_INSECURE_HOST>Allow insecure connections to a host [env: UV_INSECURE_HOST=]--no-progressHide all progress outputs [env: UV_NO_PROGRESS=]--directory <DIRECTORY>Change to the given directory prior to running the command [env:UV_WORKING_DIR=]--project <PROJECT>Discover a project in the given directory [env: UV_PROJECT=]--config-file <CONFIG_FILE>The path to a `uv.toml` file to use for configuration [env:UV_CONFIG_FILE=]--no-configAvoid discovering configuration files (`pyproject.toml`, `uv.toml`)[env: UV_NO_CONFIG=]-h, --helpDisplay the concise help for this command-V, --versionDisplay the uv versionUse `uv help` for more details.

Run a tool in an ephemeral environment using uvx (an alias for uv tool run)

Features

Python versions

Installing and managing Python itself.

  • uv python install: Install Python versions.
  • uv python list: View available Python versions.
  • uv python find: Find an installed Python version.
  • uv python pin: Pin the current project to use a specific Python version.
  • uv python uninstall: Uninstall a Python version.

Installing Python

Scripts

Executing standalone Python scripts, e.g., example.py.

  • uv run: Run a script.
  • uv add --script: Add a dependency to a script.
  • uv remove --script: Remove a dependency from a script.

Running scripts

Projects

Creating and working on Python projects, i.e., with a pyproject.toml.

  • uv init: Create a new Python project.
  • uv add: Add a dependency to the project.
  • uv remove: Remove a dependency from the project.
  • uv sync: Sync the project's dependencies with the environment.
  • uv lock: Create a lockfile for the project's dependencies.
  • uv run: Run a command in the project environment.
  • uv tree: View the dependency tree for the project.
  • uv build: Build the project into distribution archives.
  • uv publish: Publish the project to a package index.

Working on projects

Tools

Running and installing tools published to Python package indexes, e.g., ruff or black.

  • uvx / uv tool run: Run a tool in a temporary environment.
  • uv tool install: Install a tool user-wide.
  • uv tool uninstall: Uninstall a tool.
  • uv tool list: List installed tools.
  • uv tool update-shell: Update the shell to include tool executables.

Using tools

The pip interface

Manually managing environments and packages — intended to be used in legacy workflows or cases where the high-level commands do not provide enough control.

Creating virtual environments (replacing venv and virtualenv):

  • uv venv: Create a new virtual environment.

Using Python environments

Managing packages in an environment (replacing pip and pipdeptree):

  • uv pip install: Install packages into the current environment.
  • uv pip show: Show details about an installed package.
  • uv pip freeze: List installed packages and their versions.
  • uv pip check: Check that the current environment has compatible packages.
  • uv pip list: List installed packages.
  • uv pip uninstall: Uninstall packages.
  • uv pip tree: View the dependency tree for the environment.

Managing packages

Locking packages in an environment (replacing pip-tools):

  • uv pip compile: Compile requirements into a lockfile.
  • uv pip sync: Sync an environment with a lockfile.

Locking environments

Utility

Managing and inspecting uv's state, such as the cache, storage directories, or performing a self-update:

  • uv cache clean: Remove cache entries.
  • uv cache prune: Remove outdated cache entries.
  • uv cache dir: Show the uv cache directory path.
  • uv tool dir: Show the uv tool directory path.
  • uv python dir: Show the uv installed Python versions path.
  • uv self update: Update uv to the latest version.
http://www.jsqmd.com/news/934207/

相关文章:

  • 强化学习进阶:PPO_for_Pytorch支持连续与离散动作空间的实现原理
  • 微软300万美元云额度如何催化科研创新:从算力瓶颈到云端工作流实战
  • 如何永久保存微信聊天记录?3步实现个人数字记忆的完整备份方案
  • 5大关键技术突破:基于Verilog的MIPI I3C从设备实现深度解析
  • 舰船反无人机作战火力分配
  • 猫抓插件:网页视频下载难题的终极解决方案
  • QKeyMapper:Windows平台终极免费的跨设备按键映射工具,轻松实现键盘鼠标游戏手柄互通
  • Llama 2 7B-hf商业应用案例:10个成功落地场景的深度分析
  • 2026年6月上海别墅装修公司推荐:五大排行健康豪宅精造评测专业价格 - 品牌推荐
  • ShuffleNetV2_iflytek_for_Pytorch分布式训练实战:解决大规模数据集处理难题
  • Unity + XLua项目实战:VSCode里给Lua脚本打断点到底怎么配?(解决断点不生效)
  • Mac办公党福音:用Shell脚本解决iNode安全检查失败自动断网(Sonoma 14.4+可用)
  • 微软研究院ICSE连接计划:如何将顶级软件工程研究转化为工程师生产力
  • 5大核心创新:重新定义你的手机音乐播放体验
  • 保姆级教程:STM32开发者的Proteus 8.6安装与汉化全流程(附阿里云盘下载)
  • NVIDIA显卡硬件色彩校准技术深度解析:实现专业级显示色彩管理
  • 2026年6月武汉劳动纠纷律师推荐:TOP5排名专业评测维权价格适用场景 - 品牌推荐
  • 告别调参玄学!用Python手把手复现SABO优化算法(附完整代码与可视化)
  • 企业级部署指南:使用transformers serve快速搭建MiniCPM-V-4.6-gguf生产环境API
  • 048、LVGL对象对齐与布局基础
  • Spring Boot 3.2.x 踩坑实录:告别 nacos-config-starter,用 cloud 包搞定 Nacos 2.x 多环境
  • Genshin_StarRail_fps_unlocker:原神崩铁帧率解锁完整指南
  • 基于机器学习的智能邮件处理系统:从NLP到自动化任务管理
  • Boss Show Time:四大招聘平台时间展示终极指南
  • Deepspeed实战:用3D并行(数据+流水线+张量)训练你的第一个百亿参数模型
  • Qwen2-0.5B-Instruct-openmind代码生成能力评测:编程助手实战
  • Rotman透镜参数化建模与HFSS一键导入工具包(含MATLAB脚本、模板工程及可视化图表)
  • Windows性能终极优化指南:如何用AtlasOS提升30%系统效率
  • 从POPL 2013看形式化验证与高可信软件开发实践
  • Halcon实战:用局部可变形模板匹配搞定柔性电路板(FPC)的精准定位与缺陷检测