You can write scripts using any text editor you like, and run them using the basic command-line interpreter, but almost all installations of Python come with a very nice integrated development environment called idle, which offers a smarter interpreter window and also an easy-to-use editor that's aware of Python syntax. For basic information on starting up the python interpreter and writing and running scripts, see Learning Python. In order to display graphics within Python, you will also need to install a graphics package, as described under Graphics. Installation and use of the courseware modules is described under Courseware. This page deals only with the basic Python installation. To run the courseware, you need to install python and the array-handline package numpy. That should be just about everybody, but I have retained this page in case Enthought stops making their distribution available without charge, and also for users who might want some additional information about what parts of a Python installation are actually used by the courseware. Executable Python scripts will be in $(brew -prefix)/bin.Note: This page has not been updated, and is not needed by users who are using the Enthought distribution described under Quick Start or Python. Brewed Python modulesįor 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). Follow the pip documentation to install it for your system Python if you would like it. Note: macOS’s system Python does not provide pip. These should be installed via pip install. pyside, wxwidgets, pyqt, pygobject3, opencv, vtk and boost-python). If you decide to switch to the brewed Python, then reinstall all formulae with Python bindings (e.g. Warning! Python may crash (see Common Issues) when you import from a brewed Python if you ran brew install against the system Python. Additionally, Homebrew has a strict policy never to write stuff outside of the brew -prefix, so we don’t spam your system.
The reasoning for this location is to preserve your modules between (minor) upgrades or re-installations of Python. Homebrew’s site-packages directory is first created (1) once any Homebrew formulae with Python bindings are installed, or (2) upon brew install python. ~/Library/Python/3.y/lib/python/site-packages.So, for Python 3.y.z, you’ll find it at /usr/local/lib/python3.y/site-packages. $(brew -prefix )/lib/pythonX.Y/site-packages Unversioned symlinks for python, python-config, pip etc. pip3 points to Homebrew’s Python 3.y’s pip (if installed).python3 points to Homebrew’s Python 3.y (if installed).The executables are organised as follows:
On mac python install modules Patch#
Manager such as pyenv if you require stability of minor or patch versions for virtual environments. Homebrew provides formulae for maintained releases of Python 3.y ( Python may be upgraded to a newer version at any time.
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. A formula was provided until the end of 2019, at which point it was removed due to the Python 2 deprecation. Homebrew provides formulae to brew Python 3.y. Homebrew should work with any CPython and defaults to the macOS system Python. See Python for Formula Authors for advice on writing formulae to install packages written in Python. This page describes how Python is handled in Homebrew for users.