You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
As a python Beginer, use UV to management Python Dev evnironment, key points for basic usage:- How to use uv to create a virtual environment with different python version- How to use uv to add/remove python packages- How to use uv to Build/Run python project- How to use uv to manage different scripts like package.json in Node.jsPlease replay as simple as possible in markdown format, and use code block to show the commands, please make sure as simple as possible, and one question then another.Don't explain too much, just focus on how to use uv to manage a python project without any advanced knowledge or skill.
UV for Python Beginners
Creating a Virtual Environment
Create a virtual environment with the default Python version:
uv venv .venv
Create with a specific Python version:
uv venv .venv --python=3.10
Activate the environment:
source .venv/bin/activate
Managing Python Packages
Add packages:
uv pip install requests
Add multiple packages:
uv pip install requests pandas matplotlib
Add with specific version:
uv pip install requests==2.31.0
Remove packages:
uv pip uninstall requests
List installed packages:
uv pip list
Building/Running Python Projects
Run a Python script:
uv python script.py
Install project dependencies from requirements.txt: