Fixing "No preset version installed for command poetry"
Poetry is a packaging and dependency management tool for Python, and a tool that didn't exist when I worked with Python many years before I started working at Float. I also hadn't been exposed to asdf, which is a handy little tool for managing multiple runtimes.
One error that I've encountered a couple of times since I started is the No preset version installed for command poetry
one. It looks something like this:
poetry install --sync
No preset version installed for command poetry
Please install a version by running one of the following:
asdf install python 3.12.5
or add one of the following versions in your config file at <some-path>/.tool-versions
python 3.11.10
python 3.11.9
This has tended to happen when I switch between projects, and it's because while I may have installed Poetry for a specific version of Python in one project, I didn't have it installed for the project that I changed to working on.
The solution: Run pip install poetry
in that project, and then re-run your poetry install
command.
Things should work as expected going forward.
Like what you've read?
Subscribe to receive the latest updates in your inbox.