前言 / Introduction
Why I Switched to uv Instead of Anaconda
Recently, I discovered uv — a lightning-fast Python package and environment manager built in Rust. After trying it out in a few projects, I realized: Anaconda is not useful to me anymore. Here’s why I made the switch and how it improved my Python workflow.
最近我發現了uv,一個由Rust編寫的輕量化Python 套件與環境管理器。嘗試在我的幾個小專案使用後,竟發現:Anaconda 不會再是我的首選。 所以這篇文章想和大家聊聊,我為什麼選擇轉換,以及uv帶來哪些實際改善。
The Problem with Anaconda (for Me)
- Anaconda’s installation is heavy - even Miniconda is too bulky
- Package installation with
pip installis painfully slow - Unable to change Python versions in existing virtual environments
- Virtual environments can’t be easily shared across different workspaces
基於上面幾個痛點,總是讓我對Anaconda恨得牙癢癢的,但又離不開它,直到我遇見了uv。
Enter uv
uv 是由Astral建立的現代Python環境管理器,透過輕快且乾淨的特色,讓許多人留下美好的印象。下面列了幾點我喜歡的特色:
Lightning-fast environment & dependency setup
It installs everything in seconds — no exaggeration.
Drop-in replacement for pip & venv
I can keep my workflows, just faster.
Perfect for testing environments
Ideal for my QA work, especially when setting up test dependencies quickly.
How I Migrated
轉換非常簡易 (陣痛期短),就下面簡單幾個步驟:
- Created a pyproject.toml (or used one from Poetry/pip tools)
- Ran
uv venvto create the environment - Installed dependencies via
uv pip install - Done!
That’s it — no base environment, no conda init, no channel headaches.
Final Thoughts
不是說Anaconda不好用,它還是有許多使用情境,並且我相信多數人第一次接觸也是Anaconda (新人教練 東巴),但考慮到快速開發,以及加速docker image的建構,uv真的是值得考慮的。
如果你也曾被 Anaconda 的體積與安裝速度卡住,不妨試試看 uv。對我來說,它是 Python 開發環境的「輕盈革命」。
PS: 中間也有使用pyenv + poetry,但就是沒有很方便,所以始終沒有去進行替換。