Download Python for Mac Os X 10.8
Installing Python 3 on Mac Os X¶
Mac OS X comes with Python 2.vii out of the box.
You do non need to install or configure anything else to utilise Python 2. These instructions document the installation of Python 3.
The version of Python that ships with OS X is swell for learning, but it'due south not good for development. The version shipped with OS X may exist out of engagement from the official current Python release, which is considered the stable product version.
Doing it Right¶
Allow's install a real version of Python.
Before installing Python, you'll need to install GCC. GCC can be obtained past downloading Xcode, the smaller Control Line Tools (must have an Apple tree account) or the even smaller OSX-GCC-Installer parcel.
Note
If you already have Xcode installed, do not install OSX-GCC-Installer. In combination, the software tin can cause issues that are difficult to diagnose.
Annotation
If you perform a fresh install of Xcode, you volition as well need to add together the commandline tools past running xcode-select --install
on the terminal.
While Bone Ten comes with a large number of Unix utilities, those familiar with Linux systems will notice i key component missing: a package manager. Homebrew fills this void.
To install Homebrew, open up Terminal
or your favorite Bone Ten terminal emulator and run
$ /bin/fustigate -c " $(coil -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh) "
The script will explain what changes it will make and prompt you before the installation begins. Once you've installed Homebrew, insert the Homebrew directory at the acme of your PATH
surroundings variable. Yous tin do this past adding the following line at the bottom of your ~/.contour
file
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
If you have OS Ten ten.12 (Sierra) or older use this line instead
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
Now, nosotros can install Python 3:
This volition take a minute or two.
Pip¶
Homebrew installs pip
pointing to the Homebrew'd Python 3 for y'all.
Working with Python three¶
At this point, you have the system Python two.vii available, potentially the Homebrew version of Python 2 installed, and the Homebrew version of Python 3 too.
will launch the Homebrew-installed Python 3 interpreter.
will launch the Homebrew-installed Python two interpreter (if whatsoever).
volition launch the Homebrew-installed Python three interpreter.
If the Homebrew version of Python two is installed and then pip2
will betoken to Python 2. If the Homebrew version of Python 3 is installed then pip
will bespeak to Python iii.
The residuum of the guide will assume that python
references Python three.
# Practise I accept a Python 3 installed? $ python --version Python iii.seven.1 # Success!
Pipenv & Virtual Environments¶
The next step is to install Pipenv, so yous tin install dependencies and manage virtual environments.
A Virtual Environment is a tool to keep the dependencies required by different projects in divide places, by creating virtual Python environments for them. Information technology solves the "Projection X depends on version 1.x but, Projection Y needs 4.x" dilemma, and keeps your global site-packages directory clean and manageable.
For case, you can work on a project which requires Django 1.x while also maintaining a project which requires Django 1.8.
So, onward! To the Pipenv & Virtual Environments docs!
This folio is a remixed version of another guide, which is bachelor under the same license.
Download Python for Mac Os X 10.8
Posted by: schoonoverhustiles.blogspot.com
0 Comentarios