Repository navigation
venv tutorial wrong/confusing about python version used #119078
Description
Activity
If you have multiple versions of Python on your system, you can select a specific Python version by running python3 or whichever version you want.
Isn't this a bit redundant then?
@nineteendo I wondered about that and I think yes it is partially redundant, but not entirely. How about:
venv will install the Python version from which the command was run. For instance, running
python3.8will install version 3.8 specifically whereas running justpythonorpython3might install any number of versions. See the Python Setup and Usage documentation for additional details.I'd be fine reducing it to just the first sentence as well, but new users may find the additional information helpful.
Reacted by Nice ZombiesHow about mentioning
python -V? As it tells you which version will be installed. Orpython --versionHi @nineteendo ,
Have you reached a final conclusion on this issue yet?
If yes, can I take up this issue and start working on it?Sorry, for the slow response. I thought of adding
--versiontoo, but thought it might be too much with what I had before. I like the suggestion from @nineteendo, but also propose the below slightly more verbose option that might add a little more clarity:venv will install the Python version from which the command was run (as reported by the --version option). For instance, excuting the command with python3.8 will install version 3.8.
Reacted by Nice ZombiesLooks good, feel free to create a pull request.
Although, it might be more relevant to mention 3.12 or 3.13?
- added a commit that references this issue
on May 18, 2024
Documentation
From https://docs.python.org/3/tutorial/venv.html:
https://docs.python.org/3/library/venv.html#module-venv though makes it clear that the venv will use
the Python installation from which the command was run.So I believe it should be updated to:
Linked PRs