Package Management Tools
pip
Python’s official package management tool:
# Install a package
pip install requests
# Install from requirements.txt
pip install -r requirements.txt
# Upgrade a package
pip install --upgrade requests
# List installed packages
pip list
# Export dependencies
pip freeze > requirements.txt
uv (2026 Rising Star)
Next-generation Python package manager, 10-100x faster than pip:
# Install
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create project
uv create my-project
# Install dependencies
uv add requests
# Sync environment
uv sync
Virtual Environments
venv (Built-in since Python 3.3+)
# Create virtual environment
python -m venv myenv
# Activate environment
# Linux/Mac:
source myenv/bin/activate
# Windows:
myenv\Scripts\activate
# Deactivate
deactivate
uv venv
# Create virtual environment with uv (faster)
uv venv myenv
source myenv/bin/activate
Interactive Environments
IPython
Enhanced interactive Python shell:
# Install
pip install ipython
# Launch
ipython
# Common features
# - Auto-completion
# - ? for help
# - ! to run shell commands
# - %timeit for performance testing
Jupyter Notebook
# Install
pip install jupyter
# Launch
jupyter notebook
# Or use JupyterLab
pip install jupyterlab
jupyter lab
Recommended IDEs
VS Code
// Recommended settings.json
{
"python.linting.enabled": true,
"python.formatting.provider": "black",
"python.analysis.typeCheckingMode": "basic",
"python.defaultInterpreterPath": "/usr/bin/python3"
}
PyCharm
- Professional edition: full feature support
- Community edition: free, suitable for basic development
Testing Tools
pytest
# Install
pip install pytest
# Run tests
pytest
# Run specific file
pytest test_example.py
# Show verbose output
pytest -v
# Run failed tests
pytest --lf
Code Formatting
Black
# Install
pip install black
# Format code
black .
# Check format (no changes)
black --check .
Ruff (2026 Recommended)
Next-generation Python linter, extremely fast:
# Install
pip install ruff
# Check
ruff check .
# Auto-fix
ruff check --fix .
Environment Management
conda
# Create environment
conda create -n myenv python=3.11
# Activate environment
conda activate myenv
# Install packages
conda install numpy
2026 Recommended Tool Stack
| Purpose | Recommended Tool |
|---|---|
| Package management | uv (fastest) |
| Virtual environment | uv venv |
| IDE | VS Code / PyCharm |
| Testing | pytest |
| Linting | ruff |
| Formatting | black / ruff |
| Notebook | JupyterLab |
| Type checking | mypy |
Comments