Python包管理工具

uv是一个快速的Python包管理器,可替代pip、pip-tools和virtualenv,用于管理虚拟环境和安装依赖。

  • by GhosTHaise
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 ghosthaise/mcp-document-server

使用说明

星光计划与紫外线

此项目使用 紫外线,由Astral创建的快速Python包管理器。 uv 是替代品 pip, pip-tools,以及 virtualenv,设计得更快。

需求

  • Python 3.8+
  • uv 安装

安装

首先,安装 uv 如果你还没有:

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

Or use pipx:

pipx install uv

Creating a Virtual Environment

Create a virtual environment with uv:

uv venv .venv

Activate it:
	•	On Linux/macOS:

source .venv/bin/activate


	•	On Windows:

.venv\Scripts\activate



Installing Dependencies

Install the packages listed in requirements.txt (or pyproject.toml if you’re using modern packaging):

uv pip install -r requirements.txt

Or if using pyproject.toml:

uv pip install .

Adding a New Package

To add a new package:

uv pip install package-name

Freezing Dependencies

Freeze the current environment packages into requirements.txt:

uv pip freeze > requirements.txt

Why uv?
	•	Much faster than traditional pip and virtualenv
	•	Manages virtual environments and packages in one tool
	•	Built by Astral

Happy coding!

Would you also like a French version alongside it (like a bilingual `README.md`)?  
Or maybe you want a smaller **minimal version**?```