Stay Hungry,Stay Foolish!

uv --- replacement of conda + pip (python version + package version install) python版本和包管理集大成者

uv

https://docs.astral.sh/uv/

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

Shows a bar chart with benchmark results.

 

Installing Trio's dependencies with a warm cache.

Highlights

uv is backed by Astral, the creators of Ruff.

 

https://github.com/astral-sh/uv

Python management

uv installs Python and allows quickly switching between versions.

Install multiple Python versions:

$ uv python install 3.10 3.11 3.12
Searching for Python versions matching: Python 3.10
Searching for Python versions matching: Python 3.11
Searching for Python versions matching: Python 3.12
Installed 3 versions in 3.42s
 + cpython-3.10.14-macos-aarch64-none
 + cpython-3.11.9-macos-aarch64-none
 + cpython-3.12.4-macos-aarch64-none
 

Download Python versions as needed:

$ uv venv --python 3.12.0
Using Python 3.12.0
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate

$ uv run --python pypy@3.8 -- python --version
Python 3.8.16 (a9dbdca6fc3286b0addd2240f11d97d8e8de187a, Dec 29 2022, 11:45:30)
[PyPy 7.3.11 with GCC Apple LLVM 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>>
 

Use a specific Python version in the current directory:

$ uv python pin pypy@3.11
Pinned `.python-version` to `pypy@3.11`
 

See the Python installation documentation to get started.

 

posted @ 2024-10-05 12:47  lightsong  阅读(5)  评论(0编辑  收藏  举报
Life Is Short, We Need Ship To Travel