Skip to content
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

venv tutorial wrong/confusing about python version used #119078

Closed
deuberger opened this issue May 15, 2024 · 8 comments
Closed

venv tutorial wrong/confusing about python version used #119078

deuberger opened this issue May 15, 2024 · 8 comments
Labels
docs Documentation in the Doc dir

Comments

@deuberger
Copy link

deuberger commented May 15, 2024

Documentation

From https://docs.python.org/3/tutorial/venv.html:

venv will usually install the most recent version of Python that you have available. 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.

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:

venv will install the Python version from which the command was run. 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.

Linked PRs

@deuberger deuberger added the docs Documentation in the Doc dir label May 15, 2024
@nineteendo
Copy link
Contributor

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?

@deuberger
Copy link
Author

deuberger commented May 16, 2024

@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.8 will install version 3.8 specifically whereas running just python or python3 might 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.

@nineteendo
Copy link
Contributor

nineteendo commented May 16, 2024

How about mentioning python -V? As it tells you which version will be installed. Or python --version

@anushatomar13
Copy link

Hi @nineteendo ,
Have you reached a final conclusion on this issue yet?
If yes, can I take up this issue and start working on it?

@nineteendo
Copy link
Contributor

I think this should be clear enough:

venv will install the Python version shown for --version. For instance, excuting the command with python3.8 will install version 3.8.

@deuberger
Copy link
Author

Sorry, for the slow response. I thought of adding --version too, 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.

@nineteendo
Copy link
Contributor

Looks good, feel free to create a pull request.

@nineteendo
Copy link
Contributor

Although, it might be more relevant to mention 3.12 or 3.13?

miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 18, 2024
(cherry picked from commit 0f5e8be)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 18, 2024
(cherry picked from commit 0f5e8be)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
vsajip pushed a commit that referenced this issue May 18, 2024
vsajip pushed a commit that referenced this issue May 18, 2024
@vsajip vsajip closed this as completed May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

4 participants