Python?UV安裝、升級、卸載詳細(xì)步驟記錄
官方文檔詳見:https://docs.astral.sh/uv/getting-started/installation/
安裝
pip install uv
檢查
安裝后可運(yùn)行下面命令,查看是否安裝成功
uv --version
% uv --version uv 0.6.3 (a0b9f22a2 2025-02-24)
升級
uv self update
將重新運(yùn)行安裝程序 并可能修改您的shell配置文件。
要禁用此行為,設(shè)置INSTALLER_NO_MODIFY_PATH=1。
或:
pip install --upgrade uv
設(shè)置自動(dòng)補(bǔ)全
echo 'eval "$(uv generate-shell-completion bash)"' >> ~/.bashrc
echo 'eval "$(uv generate-shell-completion zsh)"' >> ~/.zshrc
卸載
執(zhí)行以下兩步:
1、清理存儲數(shù)據(jù)(可選):
$ uv cache clean $ rm -r "$(uv python dir)" $ rm -r "$(uv tool dir)"
提示:在刪除二進(jìn)制文件之前,您可能想刪除 uv 存儲的任何數(shù)據(jù)。
2、刪除 uv 和 uvx 二進(jìn)制文件:
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??梢詮哪抢飫h除這些二進(jìn)制文件。
uninstall. 升級到舊版本將不會自動(dòng)刪除二進(jìn)制文件 ~/.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.總結(jié)
到此這篇關(guān)于Python UV安裝、升級、卸載詳細(xì)步驟的文章就介紹到這了,更多相關(guān)Python UV安裝升級卸載內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
python tkinter 做個(gè)簡單的計(jì)算器的方法
這篇文章主要介紹了python tkinter 做個(gè)簡單的計(jì)算器的方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-04-04
python數(shù)據(jù)庫如何連接SQLite詳解
這篇文章主要介紹了Python實(shí)現(xiàn)連接SQLite數(shù)據(jù)庫的方法,在Python數(shù)據(jù)庫編程中有著廣泛的應(yīng)用,需要的朋友可以參考下,希望能給你帶來幫助2021-08-08
python使用PIL模塊實(shí)現(xiàn)給圖片打水印的方法
這篇文章主要介紹了python使用PIL模塊實(shí)現(xiàn)給圖片打水印的方法,涉及使用PIL模塊操作圖片的相關(guān)技巧,需要的朋友可以參考下2015-05-05
Python+OpenCV手勢檢測與識別Mediapipe基礎(chǔ)篇
網(wǎng)上搜到了一些關(guān)于手勢處理的實(shí)驗(yàn),我在這兒簡單的實(shí)現(xiàn)一下,下面這篇文章主要給大家介紹了關(guān)于Python+OpenCV手勢檢測與識別Mediapipe基礎(chǔ)篇的相關(guān)資料,需要的朋友可以參考下2022-12-12
Python標(biāo)準(zhǔn)庫sched模塊使用指南
這篇文章主要介紹了Python標(biāo)準(zhǔn)庫sched模塊使用的相關(guān)資料,需要的朋友可以參考下2017-07-07
Python PyAutoGUI模塊控制鼠標(biāo)和鍵盤實(shí)現(xiàn)自動(dòng)化任務(wù)詳解
這篇文章主要介紹了Python PyAutoGUI模塊控制鼠標(biāo)和鍵盤實(shí)現(xiàn)自動(dòng)化任務(wù),結(jié)合實(shí)例形式詳細(xì)分析了pyautogui模塊的安裝、導(dǎo)入以及針對鼠標(biāo)與鍵盤的各種常見響應(yīng)操作實(shí)現(xiàn)技巧,需要的朋友可以參考下2018-09-09
python+opencv+selenium自動(dòng)化登錄郵箱并解決滑動(dòng)驗(yàn)證的問題
本文主要講解基于python+opencv+selenium自動(dòng)化登錄郵箱并解決滑動(dòng)驗(yàn)證的問題,在這大家需要注意頁面元素定位及文本框和驗(yàn)證碼的frame嵌套問題,感興趣的朋友一起看看吧2021-07-07

