快轉到主要內容
  1. Note/

Life Is Short Use 'uv'

·1 分鐘· ·
Blog Zh-Tw Python
Liu Zhe You
作者
Liu Zhe You
涉略全端、DevOps,目前專注在 Backend
目錄
封面來自 uv 官方文件

Life Is Short Use uv
#

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

只有 可以形容uv 用過就回不去 poetry 了 !

下載
#

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

使用
#

管理虛擬環境
#

會產生虛擬環境在 .venv 資料夾

uv python pin 3.12
uv venv

# or inline command
uv venv --python 3.12

安裝套件
#

同步 pyproject.toml 的 dependencies 到虛擬環境

uv sync

安裝套件

uv add requests

pip 介面
#

uv 有提供 pip 的介面

uv pip install -r requirements.txt

常見問題
#

MacOS 預設的 ulimit 設定 ( 預設 256 ) 對於開啟的 file descriptor 數量來說太低了
這在安裝時可能會遇到 Too many open files 的錯誤。

可以修改 file descriptor 的限制,如把它設定為 2048 :

ulimit -n 2048

相關文章

解決 MacOS 安裝 `psycopg2` 常見的問題
·1 分鐘
Blog Zh-Tw Python
解決 MacOS 安裝 psycopg2 常見的問題
在 SqlAlchemy 使用 Transaction
·2 分鐘
Blog Zh-Tw SqlAlchemy Backend Python
如何在 SqlAlchemy 中使用 Transaction
Python: 重複讀取檔案(BinaryIO)
·1 分鐘
Blog Zh-Tw Python
在 Python 中重複讀取檔案 (BinaryIO),如何解決在第二次讀取時出現空內容的問題。
2024 Appier 暑期實習心得
·6 分鐘
Blog Zh-Tw Intern
在 Appier - Data Platform 部門的後端暑期實習心得
2024 Dcard 暑期實習後端作業
·6 分鐘
Blog Zh-Tw Backend Intern System-Design Dcard
2024 Dcard 暑期實習後端作業
2024 台積電暑期實習面試
·1 分鐘
Blog Zh-Tw Intern
2024 台積電暑期實習面試