Many languages have multiple package management tools, but most languages have just one or two really popular ones.
As for python, when you’re trying to get started on an unfamiliar project, you just have to memorize this basically (and chances are roughly equal for which one you’ll run into):
- Does the project have a setup.py? if so, first run several other commands before you can run it.
python -m venv .venv && source .venv/bin/activate && pip install -e . - else does it have a requirements.txt? if so
python -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt - else does it have a pyproject.toml? if so
poetry installand then prefix all commands withpoetry run ... - else does it have a pipfile?
pipenv installand then prefix all commands withpipenv run ... - else does it have an environment.yml? if so
conda env create -f environment.ymland then look inside the file andconda activate <environment_name> - else …
I have not really had to learn the rules for uv yet but hopefully it replaces all of these. I think many believe it will do just that.
notes
- actually these days I often just open up a tab in Cursor and say “get this project running” instead of actually trying to figure it out myself
- relevant xkcd 927