Thanks to visit codestin.com
Credit goes to github.com

Skip to content

added note about python 3 to venv #26084

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

Merged
merged 1 commit into from
Jun 15, 2023
Merged

Conversation

story645
Copy link
Member

@story645 story645 commented Jun 7, 2023

PR summary

Apparently on mac, python may not be added to path but python 3 is, so small note to flag that. (also demoing draft pr)

@story645 story645 marked this pull request as ready for review June 7, 2023 16:38
@tacaswell
Copy link
Member

Do we want to cross-reference https://peps.python.org/pep-0394 ? Mac may be the most common hold out here, but what python does is at the discretion of the system. I think most "modern" linux distros have moved over but I have not done the leg work to sort out when they transitioned (and at least ubuntu went through a period where python just did not exist).

@ksunden
Copy link
Member

ksunden commented Jun 7, 2023

On my pop os (ubuntu derivative) system, python is not symlinked, if I use system python I still need python3 (now, I don't actually use system python, but still)

Perhaps we should just change the example to use python3, which should be provided on all systems by that pep. (and if people know that just python works, they can continue to use it, but it won't hurt if they do python3 for the one command (unless their environment is broken enough for python3 and python point to different python (3, since if it points to 2 it won't work for us) versions.

@timhoffm
Copy link
Member

timhoffm commented Jun 7, 2023

Pep-394 states

While far from being universally available, python remains the preferred spelling for explicitly invoking Python

So I would not universally go for python3.

@jklymak
Copy link
Member

jklymak commented Jun 7, 2023

Have wheels progressed to the level where we want our beginner install docs to talk about venv first rather than conda? I think anyone who uses the system version of Python on a Mac is probably going to be sad sooner rather than later.

@ksunden
Copy link
Member

ksunden commented Jun 7, 2023

The continuation of that sentence, though, is:

as this is the spelling that virtual environments make consistently available across different platforms and Python installations.

Since the particular case in this example is "how do I set up a venv from system python", that implies that this is the particular case where that can't be relied on...

@ksunden
Copy link
Member

ksunden commented Jun 7, 2023

To be clear, I am perfectly fine to leave it as python in the main flow and add the note, with less specificity as it is not just "mac", I just don't fully agree that that the "preferred spelling is python" fully applies here.

@story645
Copy link
Member Author

story645 commented Jun 7, 2023

I accepted the commit but I'm hesitant on linking out to the pep cause it might overwhelm the target audience.

@timhoffm
Copy link
Member

timhoffm commented Jun 7, 2023

You could prepare that with context:

For the technical reasons see PEP-394

and/or: put this sentence in a footnote? That would make it less prominent.

@story645 story645 force-pushed the install branch 2 times, most recently from c823a1d to b8d3a84 Compare June 7, 2023 21:16
@@ -127,6 +127,9 @@ The simplest way to do this is to use either Python's virtual environment
<file folder location>\Scripts\activate.bat # Windows cmd.exe
<file folder location>\Scripts\Activate.ps1 # Windows PowerShell

On some systems, you may need to type ``python3`` instead of ``python``.
For the technical reasons for this note, please see `PEP-394 <https://peps.python.org/pep-0394>`_.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For the technical reasons for this note, please see `PEP-394 <https://peps.python.org/pep-0394>`_.
For the technical reasons, please see `PEP-394 <https://peps.python.org/pep-0394>`_.

Can be left out because it does not add information.

Copy link
Member Author

@story645 story645 Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clause felt a little ambiguous without it.

Co-authored-by: esibinga <[email protected]>

Co-authored-by: Tim Hoffmann <[email protected]>
@story645 story645 requested a review from timhoffm June 14, 2023 15:24
@tacaswell tacaswell added this to the v3.7-doc milestone Jun 15, 2023
@tacaswell tacaswell merged commit e9e3579 into matplotlib:main Jun 15, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jun 15, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jun 15, 2023
@story645 story645 deleted the install branch June 15, 2023 20:01
ksunden added a commit that referenced this pull request Jun 15, 2023
…084-on-v3.7.x

Backport PR #26084 on branch v3.7.x (added note about python 3 to venv)
ksunden added a commit that referenced this pull request Jun 15, 2023
…084-on-v3.7.1-doc

Backport PR #26084 on branch v3.7.1-doc (added note about python 3 to venv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants