Python UV安装、升级、卸载详细步骤记录
官方文档详见:https://docs.astral.sh/uv/getting-started/installation/
安装
pip install uv
检查
安装后可运行下面命令,查看是否安装成功
uv --version
% uv --version uv 0.6.3 (a0b9f22a2 2025-02-24)
升级
uv self update
将重新运行安装程序 并可能修改您的shell配置文件。
要禁用此行为,设置INSTALLER_NO_MODIFY_PATH=1。
或:
pip install --upgrade uv
设置自动补全
echo 'eval "$(uv generate-shell-completion bash)"' >> ~/.bashrc
echo 'eval "$(uv generate-shell-completion zsh)"' >> ~/.zshrc
卸载
执行以下两步:
1、清理存储数据(可选):
$ uv cache clean $ rm -r "$(uv python dir)" $ rm -r "$(uv tool dir)"
提示:在删除二进制文件之前,您可能想删除 uv 存储的任何数据。
2、删除 uv 和 uvx 二进制文件:
macOS 和 Linux
$ rm ~/.local/bin/uv ~/.local/bin/uvx
Windows
$ rm $HOME.local\bin\uv.exe $ rm $HOME.local\bin\uvx.exe
注意:在0.5.0之前,uv被安装到了~/.cargo/bin。可以从那里删除这些二进制文件。
uninstall. 升级到旧版本将不会自动删除二进制文件 ~/.cargo/bin.
UV 命令
% uv
An extremely fast Python package manager.
Usage: uv [OPTIONS] <COMMAND>
Commands:
run Run a command or script
init Create a new project
add Add dependencies to the project
remove Remove dependencies from the project
sync Update the project's environment
lock Update the project's lockfile
export Export the project's lockfile to an alternate format
tree Display the project's dependency tree
tool Run and install commands provided by Python packages
python Manage Python versions and installations
pip Manage Python packages with a pip-compatible interface
venv Create a virtual environment
build Build Python packages into source distributions and wheels
publish Upload distributions to an index
cache Manage uv's cache
self Manage the uv executable
version Display uv's version
help Display documentation for a command
Cache options:
-n, --no-cache Avoid reading from or writing to the cache,
instead using a temporary directory for the
duration of the operation [env: UV_NO_CACHE=]
--cache-dir <CACHE_DIR> Path to the cache directory [env: UV_CACHE_DIR=]
Python options:
--python-preference <PYTHON_PREFERENCE>
Whether to prefer uv-managed or system Python installations [env:
UV_PYTHON_PREFERENCE=] [possible values: only-managed, managed,
system, only-system]
--no-python-downloads
Disable automatic downloads of Python. [env:
"UV_PYTHON_DOWNLOADS=never"]
Global options:
-q, --quiet
Do not print any output
-v, --verbose...
Use verbose output
--color <COLOR_CHOICE>
Control the use of color in output [possible values: auto, always,
never]
--native-tls
Whether to load TLS certificates from the platform's native
certificate store [env: UV_NATIVE_TLS=]
--offline
Disable network access [env: UV_OFFLINE=]
--allow-insecure-host <ALLOW_INSECURE_HOST>
Allow insecure connections to a host [env: UV_INSECURE_HOST=]
--no-progress
Hide all progress outputs [env: UV_NO_PROGRESS=]
--directory <DIRECTORY>
Change to the given directory prior to running the command
--project <PROJECT>
Run the command within the given project directory
--config-file <CONFIG_FILE>
The path to a `uv.toml` file to use for configuration [env:
UV_CONFIG_FILE=]
--no-config
Avoid discovering configuration files (`pyproject.toml`, `uv.toml`)
[env: UV_NO_CONFIG=]
-h, --help
Display the concise help for this command
-V, --version
Display the uv version
Use `uv help` for more details.总结
到此这篇关于Python UV安装、升级、卸载详细步骤的文章就介绍到这了,更多相关Python UV安装升级卸载内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
Python+OpenCV手势检测与识别Mediapipe基础篇
网上搜到了一些关于手势处理的实验,我在这儿简单的实现一下,下面这篇文章主要给大家介绍了关于Python+OpenCV手势检测与识别Mediapipe基础篇的相关资料,需要的朋友可以参考下2022-12-12
Python PyAutoGUI模块控制鼠标和键盘实现自动化任务详解
这篇文章主要介绍了Python PyAutoGUI模块控制鼠标和键盘实现自动化任务,结合实例形式详细分析了pyautogui模块的安装、导入以及针对鼠标与键盘的各种常见响应操作实现技巧,需要的朋友可以参考下2018-09-09
python+opencv+selenium自动化登录邮箱并解决滑动验证的问题
本文主要讲解基于python+opencv+selenium自动化登录邮箱并解决滑动验证的问题,在这大家需要注意页面元素定位及文本框和验证码的frame嵌套问题,感兴趣的朋友一起看看吧2021-07-07


最新评论