Skip to main content
  1. Note/

Life Is Short Use 'uv'

·1 min· ·
Blog En Python
Liu Zhe You
Author
Liu Zhe You
Skilled in full-stack development and DevOps, currently focusing on Backend.
Table of Contents

The cover is from the official uv documentation.

Life Is Short Use uv
#

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

Only fast can describe uv. Once you use it, you won’t go back to poetry!

Download
#

curl -LsSf https://astral.sh/uv/install.sh | sh

Usage
#

Manage Virtual Environments
#

Creates a virtual environment in the .venv folder

uv python pin 3.12
uv venv

# or inline command
uv venv --python 3.12

Install Packages
#

Sync the dependencies from pyproject.toml to the virtual environment

uv sync

Install a package

uv add requests

pip Interface
#

uv provides an interface for pip

uv pip install -r requirements.txt

FAQ
#

The default ulimit setting on MacOS (default 256) is too low for the number of open file descriptors.
This may cause a Too many open files error during installation.

You can change the file descriptor limit, for example, set it to 2048:

ulimit -n 2048

Related

Resolve `psycopg2` Install Error on MacOS
·1 min
Blog En Python
Resolve psycopg2 Install Error on MacOS
How to use Transaction in SqlAlchemy
·2 mins
Blog En SqlAlchemy Backend Python
How to transaction in SqlAlchemy
Python: Read File(BinaryIO) Multiple Time
·1 min
Blog En Python
Read file (BinaryIO) multiple time in Python. Solution to prevent empty content in the second read.
2024 Appier Summer Internship Reflection
·12 mins
Blog En Intern
Reflection on my backend summer internship in the Data Platform department at Appier
2024 Dcard Backend Intern Assignment
·7 mins
Blog En Backend Intern System-Design Dcard
2024 Dcard Backend Intern Assignment
2024 TSMC Summer Intern Interview
·3 mins
Blog En Intern
2024 TSMC Summer Intern Interview