How to Download Python 3.6 for Mac Updated

How to Download Python 3.6 for Mac

Installing Python 3 on Mac Os Ten

https://d33wubrfki0l68.cloudfront.net/02962eb19c0069740d16e67b5ba7c613238c8b9a/30ed2/_images/34435689480_2e6f358510_k_d.jpg

Mac Bone Ten comes with Python 2.7 out of the box.

You lot do not need to install or configure annihilation else to utilize 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'southward not good for development. The version shipped with Os Ten may be out of date from the official current Python release, which is considered the stable product version.

Doing it Right

Let's install a real version of Python.

Before installing Python, you'll need to install GCC. GCC can be obtained by downloading Xcode, the smaller Command Line Tools (must have an Apple account) or the even smaller OSX-GCC-Installer parcel.

Note

If you already have Xcode installed, exercise not install OSX-GCC-Installer. In combination, the software tin can cause bug that are hard to diagnose.

Note

If you lot perform a fresh install of Xcode, you lot will besides need to add the commandline tools by running xcode-select --install on the concluding.

While Bone 10 comes with a large number of Unix utilities, those familiar with Linux systems will notice one key component missing: a package manager. Homebrew fills this void.

To install Homebrew, open up Terminal or your favorite OS X terminal emulator and run

                            $              /bin/bash -c              "              $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)              "            

The script will explicate what changes it volition make and prompt you lot before the installation begins. Once yous've installed Homebrew, insert the Homebrew directory at the peak of your PATH environs variable. Y'all can do this by adding the post-obit line at the bottom of your ~/.profile file

                            export PATH="/usr/local/opt/python/libexec/bin:$PATH"            

If you take Os X 10.12 (Sierra) or older use this line instead

                            export PATH=/usr/local/bin:/usr/local/sbin:$PATH            

Now, nosotros can install Python 3:

This will accept a minute or two.

Pip

Homebrew installs pip pointing to the Homebrew'd Python 3 for you.

Working with Python iii

At this indicate, you have the system Python two.vii bachelor, potentially the Homebrew version of Python ii installed, and the Homebrew version of Python 3 equally well.

volition launch the Homebrew-installed Python 3 interpreter.

volition launch the Homebrew-installed Python 2 interpreter (if any).

volition launch the Homebrew-installed Python iii interpreter.

If the Homebrew version of Python ii is installed then pip2 volition point to Python 2. If the Homebrew version of Python 3 is installed then pip will point to Python three.

The residuum of the guide will assume that python references Python three.

                            #              Do I have a Python              3              installed?              $              python --version              Python three.seven.1 # Success!            

Pipenv & Virtual Environments

The next stride is to install Pipenv, and so y'all can install dependencies and manage virtual environments.

A Virtual Environs is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the "Project 10 depends on version 1.10 simply, Project Y needs 4.x" dilemma, and keeps your global site-packages directory make clean and manageable.

For example, you tin work on a project which requires Django 1.10 while also maintaining a projection which requires Django 1.8.

So, onward! To the Pipenv & Virtual Environments docs!


This folio is a remixed version of some other guide, which is available nether the same license.

How to Download Python 3.6 for Mac

Posted by: arnoldemannotill.blogspot.com

إرسال تعليق

أحدث أقدم