-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error message when command was not found #566
Comments
The message doesn't mean you're required to prepare .python-version. It just means it is written; the named executable is not found in currently activated versions. Your fix is just misleading. |
Thanks for your quick reply @yyuu. However the issue still remains. Probably I do not understand the whole picture here but I'm sure I'm not alone. Do you agree that the current error message does not help users to solve the problem in any way? Of course for the designer of the Would a better error message be:
|
I agree with @axelpale that the currently implemented error message is confusing. |
The error message could be improved, yes.
|
It's odd to me that this would be designed this way, all installed versions show up in my path. I can tab complete python>> and see all pyenv installed versions, but the shims return an error message. Versions that cannot be executed should not show up on the path or pyenv should default to whatever is set for the current scope, or fallback to anything available e.g. python3.5 would always refer to some python3.5 if one is available. The current functionality makes python version availability detection in scripts more convoluted because now you have to execute the shim and check for a return code... but executing python would require you to now run the pythonx.y --version binary etc. Makes version detection more complicated then a simple Looking in to a way around this still |
Using I think it makes sense to not activate all versions by default, since you might have dozens (e.g. when using pyenv-virtualenv etc). |
…ng a Venv environment Pyenv will declare that a Python versions exists when checked by `command -v python<x.y>` even if the version will not run when called this way because of a conflict between the global and local setting (see pyenv/pyenv#566 (comment)). Call Python directly to check whether the Python x.y version is accessible (ie exists and, for Pyenv, set to run).
The problem that led to Issue #34 and this question in Stack Overflow is easily fixed by a better error message.
Currently if no
.python-version
exists in the current directory, the following message is printed:The message does not inform user in any way what is wrong and what should be done to fix the situation. For me and my employer, I have lost about one hour of work to figure out what was wrong. Therefore my employer just lost about 20 dollars because the poor error message.
Hence, I suggest the following alternative message:
The text was updated successfully, but these errors were encountered: