pyenv / pyenv-virtualenv

a pyenv plugin to manage virtualenv (a.k.a. python-virtualenv)
MIT License
6.18k stars 399 forks source link

More helpful error message when requesting a nonexistent base version #454

Closed MarcinKonowalczyk closed 1 year ago

MarcinKonowalczyk commented 1 year ago

Added a more helpful error message for when you're trying to create a virtual environment with python version which is not installed. As a user i keep running into this: i want to make a particular vent but i don't have the python and i have

If I try to install a non-existent python with peen I get something like that:

python-build: definition not found: 3.9.99

See all available versions with `pyenv install --list'.

If the version you need is missing, try upgrading pyenv.

with a possibility of getting even more help by listing all the candidates which contain the version passed and trying to be helpful as to how to upgrade pyenv (implementation form 2.3.17 ca be seen here. This is a bit much to do here so I've just added the 'See all available versions...' line.

MarcinKonowalczyk commented 1 year ago

I've run the tests with bats ./test and they're all ok. I was honestly expecting bats ./test/python.bats to fail on the 3rd test, but it didn't, and i don't know enough about bats to check whether its a proper behaviour or not.

MarcinKonowalczyk commented 1 year ago

also run bats ./test and all tests pass