Skip to content

Commit

Permalink
Merge pull request #17922 from Homebrew/ww/pydocs
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw committed Aug 1, 2024
2 parents 0ded315 + 52fd495 commit d29acdd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/Homebrew-and-Python.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ $(brew --prefix python)/libexec/bin

The Python formulae install [pip](https://pip.pypa.io/) (as `pip3`). [email protected] and older Python formulae also install [Setuptools](https://pypi.org/project/setuptools/).

Starting with [email protected], the bundled Python packages should be updated by reinstalling brewed Python. For older Python formulae, they can be updated as described below.
Starting with Python 3.12, the bundled Python packages should be updated by reinstalling brewed Python. For older Python formulae, they can be updated as described below.

**Warning!** The steps below **do not work** for Homebrew's Python 3.12 or newer. If you need a newer version of `pip` or `setuptools` than comes with the Homebrewed Python, you **must** use a virtual environment or other isolation mechanism [per below](#pep-668-and-virtual-environments).

Setuptools can be updated via `pip`, without having to reinstall brewed Python:

Expand Down Expand Up @@ -84,9 +86,9 @@ Since the system Python may not know which compiler flags to set when building b
CFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" pip install <package>
```

## PEP 668 ([email protected]) and virtual environments
## PEP 668 and virtual environments

Starting with Python@3.12, Homebrew follows [PEP 668](https://peps.python.org/pep-0668/#marking-an-interpreter-as-using-an-external-package-manager).
Starting with Python 3.12, Homebrew follows [PEP 668](https://peps.python.org/pep-0668/#marking-an-interpreter-as-using-an-external-package-manager).

If you wish to install a non-brew-packaged Python package (from PyPI for example):

Expand Down

0 comments on commit d29acdd

Please sign in to comment.