realpython / realpython/python-guide
Describing making Python 3 the default `python` under Homebrew
Nessuno ha ancora preso questa issue.
- Lingua principale
- Batchfile
- Stelle
- 29.8k
- Fork
- 5.9k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
So, about this section in the OS X installation guides:
That opt/python/libexec behavior is not actually about 10.12 Sierra vs. newer versions of macOS. Homebrew does not make the unqualified python command be Python 3 on any version of macOS. If this behavior was different in the past, that was due to a different Homebrew version, not a different macOS version. (Homebrew's policy is to not shadow system-provided components in a way that might break things.)
Maybe this section should be updated to something like:
Once you've installed Homebrew, insert the Homebrew directory at the top
of your :envvar:`PATH` environment variable if you are running 10.12 Sierra or older.
You can do this by adding the following line at the bottom of your :file:`~/.profile` file:
.. code-block:: console
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
Now, we can install Python 3:
.. code-block:: console
$ brew install python
Then, to make your default `python` command point to Python 3:
.. code-block:: console
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
And the section in the Python 2 installation about doing PATH="/usr/local/opt/python@2/libexec/bin:$PATH" is no longer necessary: the Homebrew python@2 formula now provides a python command that is in /usr/local/bin by default.
Might also want to provide a link to Homebrew's Homebrew and Python page, which goes in to more detail.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Cerca nelle guide all’installazione di OS X la sezione su Homebrew e Python 3 mostrata nell’issue, quindi leggi la pagina di Homebrew dedicata a Homebrew e Python per conoscere il comportamento attuale. Aggiorna le istruzioni per Python 3 e Python 2 in modo che riflettano la gestione di PATH e includano un link alla documentazione di Homebrew; il lavoro è completato quando la distinzione tra le versioni di macOS e il comportamento predefinito del comando python sono corretti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 35/100