pip / Poetry / pipenv
Use the bash tool for Python dependency management.
Setup
Check if installed:
command -v python3 && python3 --version command -v pip && pip --version command -v poetry && poetry --versionInstall:
# Python & pip # macOS brew install python3 # Ubuntu / Debian sudo apt update && sudo apt install -y python3 python3-pip # Poetry (official installer) curl -sSL https://install.python-poetry.org | python3 -
pip
pip install <pkg>
pip install -r requirements.txt
pip freeze > requirements.txt
pip list --outdated
pip audit
Poetry
poetry init
poetry add <pkg>
poetry add --group dev <pkg>
poetry install
poetry lock
poetry show --tree
poetry run python script.py
poetry build
poetry publish
pipenv
pipenv install <pkg>
pipenv install --dev <pkg>
pipenv lock
pipenv run python script.py
pipenv check
Virtual Environments
python -m venv .venv
source .venv/bin/activate
deactivate
Tips
- Detect tool by file: requirements.txt (pip), pyproject.toml (poetry), Pipfile (pipenv)
- Use pip audit or safety check for vulnerability scanning
- Use poetry for new projects (better dependency resolution)
Converted and distributed by TomeVault — claim your Tome and manage your conversions.