This page describes how Python is handled in Homebrew for users. See Python for Formula Authors for advice on writing formulae to install packages written in Python.
Gdbm: 1.19: GNU database manager: mpdecimal: 2.5.1: Library for decimal floating point arithmetic: openssl@1.1: 1.1.1k: Cryptography and SSL/TLS Toolkit: readline. Anaconda is a package manager, an environment manager, and Python distribution that contains a collection of many open source packages. Lumion 9 pro crack. An installation of Anaconda comes with many packages such as numpy, scikit-learn, scipy, and pandas preinstalled and is also the recommended way to install Jupyter Notebooks. Install Apache Spark using Homebrew. Homebrew can be used to install other technologies like Apache Spark. Apache Spark is not the easiest to install, but Homebrew makes it easier. Google chrome 79.0 3945.117 download. The steps below go over how to install Apache Spark using Homebrew. Look to see if there is a Apache Spark package on Homebrew using the command below.
Homebrew should work with any CPython and defaults to the macOS system Python.
Homebrew provides formulae to brew Python 3.x.
Homebrew provided a python@2
formula until the end of 2019, at which point it was removed due to the Python 2 deprecation.
Important: If you choose to use a Python which isn’t either of these two (system Python or brewed Python), the Homebrew team cannot support any breakage that may occur.
Python 3.x
Homebrew provides a formula for Python 3.x (python@3.x
).
Important: Python may be upgraded to a newer version at any time. Consider using a versionmanager such as pyenv
if you require stability of minor or patch versions for virtual environments.
The executables are organised as follows:
python3
points to Homebrew’s Python 3.x (if installed)pip3
points to Homebrew’s Python 3.x’s pip (if installed)
Unversioned symlinks for python
, python-config
, pip
etc. are installed here:
Setuptools, Pip, etc.
The Python formulae install pip (as pip3
) and Setuptools.
Setuptools can be updated via pip3, without having to re-brew Python:
Similarly, pip3 can be used to upgrade itself via:
Conda Install From File
site-packages
and the PYTHONPATH
The site-packages
is a directory that contains Python modules (especially bindings installed by other formulae). Homebrew creates it here:
So, for Python 3.y.z, you’ll find it at /usr/local/lib/python3.y/site-packages
.
Python 3.y also searches for modules in:
/Library/Python/3.y/site-packages
~/Library/Python/3.y/lib/python/site-packages
Homebrew’s site-packages
directory is first created if (1) any Homebrew formula with Python bindings are installed, or (2) upon brew install python
.
Why here?
The reasoning for this location is to preserve your modules between (minor) upgrades or re-installations of Python. Additionally, Homebrew has a strict policy never to write stuff outside of the brew --prefix
, so we don’t spam your system.
Homebrew-provided Python bindings
Some formulae provide Python bindings.
Warning! Python may crash (see Common Issues) if you import <module>
from a brewed Python if you ran brew install <formula_with_python_bindings>
against the system Python. If you decide to switch to the brewed Python, then reinstall all formulae with Python bindings (e.g. pyside
, wxwidgets
, pygtk
, pygobject
, opencv
, vtk
and boost-python
).
Policy for non-brewed Python bindings
These should be installed via pip install <package>
. To discover, you can use pip search
or https://pypi.python.org/pypi.
Note: macOS’s system Python does not provide pip
. Follow the pip documentation to install it for your system Python if you would like it.
Brewed Python modules
For brewed Python, modules installed with pip3
or python3 setup.py install
will be installed to the $(brew --prefix)/lib/pythonX.Y/site-packages
directory (explained above). Executable Python scripts will be in $(brew --prefix)/bin
.
The system Python may not know which compiler flags to set in order to build bindings for software installed in Homebrew so you may need to run:
Virtualenv
WARNING: When you brew install
formulae that provide Python bindings, you should not be in an active virtual environment.
Activate the virtualenv after you’ve brewed, or brew in a fresh terminal window.Homebrew will still install Python modules into Homebrew’s site-packages
and not into the virtual environment’s site-package.
Virtualenv has a --system-site-packages
switch to allow “global” (i.e. Homebrew’s) site-packages
to be accessible from within the virtualenv.
Why is Homebrew’s Python being installed as a dependency?
Formulae that declare an unconditional dependency on the 'python'
formula are bottled against Homebrew’s Python 3.x and require it to be installed.
Instructions for a supported install of Homebrew are on the homepage.
This script installs Homebrew to its preferred prefix (/usr/local
for macOS Intel, /opt/homebrew
for Apple Silicon) so thatyou don’t need sudo when youbrew install
. It is a careful script; it can be run even if you have stuffinstalled in /usr/local
already. It tells you exactly what it will do beforeit does it too. You have to confirm everything it will do before it starts.
macOS Requirements
- A 64-bit Intel CPU or Apple Silicon CPU 1
- macOS Mojave (10.14) (or higher) 2
- Command Line Tools (CLT) for Xcode:
xcode-select --install
,developer.apple.com/downloads orXcode3 - A Bourne-compatible shell for installation (e.g.
bash
orzsh
) 4
Git Remote Mirroring
You can set HOMEBREW_BREW_GIT_REMOTE
and/or HOMEBREW_CORE_GIT_REMOTE
in your shell environment to use geolocalized Git mirrors to speed up Homebrew’s installation with this script and, after installation, brew update
.
The default Git remote will be used if the corresponding environment variable is unset.
Alternative Installs
Linux or Windows 10 Subsystem for Linux
Check out the Homebrew on Linux installation documentation.
Untar anywhere
Just extract (or git clone
) Homebrew wherever you want. Just avoid:
- Directories with names that contain spaces. Homebrew itself can handle spaces, but many build scripts cannot.
/tmp
subdirectories because Homebrew gets upset./sw
and/opt/local
because build scripts get confused when Homebrew is there instead of Fink or MacPorts, respectively.
However do yourself a favour and install to /usr/local
on macOS Intel, /opt/homebrew
on macOS ARM,and /home/linuxbrew/.linuxbrew
on Linux. Some things maynot build when installed elsewhere. One of the reasons Homebrew justworks relative to the competition is because we recommend installinghere. Pick another prefix at your peril!
Multiple installations
Create a Homebrew installation wherever you extract the tarball. Whichever brew
command is called is where the packages will be installed. You can use this as you see fit, e.g. a system set of libs in /usr/local
and tweaked formulae for development in ~/homebrew
.
Uninstallation
Uninstallation is documented in the FAQ.
1 For 32-bit or PPC support seeTigerbrew.
2 10.14 or higher is recommended. 10.9–10.13 aresupported on a best-effort basis. For 10.4-10.6 seeTigerbrew.
3 Most formulae require a compiler. A handfulrequire a full Xcode installation. You can install Xcode, the CLT, or both;Homebrew supports all three configurations. Downloading Xcode may require anApple Developer account on older versions of Mac OS X. Sign up for freehere.
Anaconda Install
4 The one-liner installation method found onbrew.sh requires a Bourne-compatible shell (e.g. bash orzsh). Notably, fish, tcsh and csh will not work.