Anaconda Software Download For Mac
This guide walks through building and installing the TensorFlow binary from source on a macOS system. I am publishing this as a reference for myself but hopefully others might find it useful.
- Download Anaconda Python Software
- Anaconda Software Download For Mac Windows 10
- Anaconda Software Download For Mac Os
This procedure was tested with the following assumptions:
- macOS High Sierra
- Intel Core i7 Processor
- TensorFlow 1.4.1
- Homebrew 1.3.8
- Python 3.6.2
- JDK 8u152
- Bazel 0.8.1
Note that the resulting binary we build will be optimized for CPU support only.
Anaconda is the birthplace of Python data science. We are a movement of data scientists, data-driven enterprises, and open source communities. To use Anaconda on MacOS, you will primarily use the Anaconda Navigator; It lets you manage the installed python tools, create custom setups, and launch tools like Jupyter. The easiest way to launch the Anaconda Navigator is from inside the Applications folder: The navigator will start up and greet you with a list of installed and available tools.
Installing Bazel on macOS
Install Java Development Kit
At the time of publication, Bazel required the Java Development Kit 8.0. If it is not already installed follow these steps.
- Download the DMG image that containers the JDK installer from Oracle's Java SE Development Kit 8 Downloads page.
- The file should be named something like
jdk-8u152-macosx-x64.dmg
. - Mount the DMG image, double-click the installer, and follow the guided prompts.
Install Bazel
This procedures assumes you are using Homebrew. You can refer to the Bazel documentation for alternatives.
- From a Terminal, execute
brew install bazel
to install Bazel using Homebrew. - Confirm Bazel is installing by verifying the output of
bazel version
.
Install Python Dependencies
It is strongly recommended that you use a virtualenv or Conda environment to isolate the packages and installation of TensorFlow from source. This enables you to maintain multiple combinations of package versions for various projects or experiments.
Since I use Anaconda, I created a new environment by executing the command conda create -n tfsrc python=3.6
.
TensorFlow requires the following Python packages:
- six
- NumPy
- wheel
If these are not present on your machine or current environment execute the following to install:
$ pip install six numpy wheel
Prepare the TensorFlow Installation
Clone the TensorFlow Repository
Clone the latest TensorFlow repository by issuing the following command:
$ git clone https://github.com/tensorflow/tensorflow
This will take a short while depending on your Internet connection bandwidth due to the repository's size (~250 MB).
If you wish to install a release version rather than trunk you can display the available releases and check out one using the following command sequence (example is TensorFlow release 1.4):
Configure and Build the TensorFlow pip Package
I've posted a script that is based on the work of Sasha Nikiforov and a Stackoverflow post with a few minor modifications to support Anaconda environments. Here are the contents:
Clone the build_tf.sh script gist to the same directory containing the TensorFlow source:
Make the script executable:
$ chmod u+x build_tf.sh
Execute the script to configure and build the TensorFlow pip package using all of the CPU optimizations available for your CPU:
$ ./build_tf.sh
During the TensorFlow configuration process, accept all the defaults by pressing the Enter key repeatedly until the configuration is complete unless you have a specific need.
This build process will take some time to complete. In my experience it averages around 30 minutes, but a system with more than 16GB of RAM will compile faster.
The script will build a .whl file and store it in the /tmp/tensorflow_pkg directory.
Installing TensorFlow
The final step is to install the custom-built TensorFlow binary using the wheel file. The specific name of the while will vary depending on the version of TensorFlow and Python in your environment.
In my case, the command to install is:
Verify Installation
The last step is to confirm that TensorFlow is now installed and working as expected. Before proceeding be sure that you change to a directory other than the one that contains the TensorFlow source tree. We want to import the pip installed package and not the one in the source directory.
Launch the python
interactive shell and execute the following commands:
If the system outputs the following, then TensorFlow is installed and working:
- 1Download and install Python
Download and install Python[edit]
We're going to be installing Python using a software collection that includes Python. The collection is called Anaconda. Anaconda includes the Python programming language and a bunch of different pieces of software that are useful for data science and analysis. Although the collection includes all free software, it is put together by a commercial company called Continuum Analytics.
Note: Even if you already have a version of Python on your computer, we suggest you follow these instructions and download Anaconda. This will help ensure that you can follow along during our in-class activities, and will make it easier for mentors to help you if you get stuck on something.
Download option #1[edit]
Try to download the installer from this file which contains Anaconda and Python 3.7 for MacOS.
Download option #2[edit]
If option 1 above doesn't work for any reason, download the Python 3.7 option from Anaconda's website. If necessary, scroll down to the 'Anaconda 2019.10 for macOS Installer' section.
Installation[edit]
If you are on MacOS 10.15 (Catalina), you must follow an additional step which is noted below. If you don't, Anaconda won't work quite right! |
To install Anaconda, simply open the package and follow the prompts. You may be asked to enter your password by Package Installer.
Make sure you download the version for Python3
Opening the file with Package Installer will guide you through the setup process
You may be prompted for your password
Package Installer will install Anaconda3
Install notes[edit]
- If you get stuck during the install process, ask a neighbor or raise your hand for help. These instructions may also be helpful.
- At the end of the installer, you may be prompted if you'd like to send the installation package to the trash. Doing so won't damage the installation and will free up ~600MB of disk space on your computer.
Special Steps for people using Mac OS 10.15[edit]
If you are using MacOS 10.15 (Catalina) or above, you will need to configure the system to recognize Anaconda. You can find out which version of MacOS you have: you can click the Apple menu icon at the top left corner of your screen and then select the “About This Mac” command.
If the version number says 10.15 or higher it means you have a pretty new computer (congratulations on that). It also means that you will need to have to do an additional step. It might be a good idea to raise your hand and ask a mentor for help with this part.
To do so, open Terminal.app (either using Command-space or opening Applications > Utilities > Terminal.app and entering the following:
You should end up with something like this:
Once you're done, you can quit Terminal (either with Command-Q or the menu option Terminal > Quit Terminal).
Test your Python install[edit]
To use Anaconda on MacOS, you will primarily use the Anaconda Navigator; It lets you manage the installed python tools, create custom setups, and launch tools like Jupyter.
The easiest way to launch the Anaconda Navigator is from inside the Applications folder:
Download Anaconda Python Software
The navigator will start up and greet you with a list of installed and available tools:
One of the options (it's the middle option in the screenshot) should be called 'Jupyter Notebook'. Click that to open Jupyter Notebook! After a few seconds, you'll see a new tab open in your default browser. It will look something like this:
Your default browser is where you'll be working with Jupyter Notebooks.
If for some reason you don't see something in your browser, let a mentor know.
When you launched the notebook from Anaconda, you may have noticed a Terminal window popped up, like this:
You can hide it, but do not close it during the whole time when you are using the Jupyter Notebook. If you close it, your Jupyter Notebook will be closed automatically.
To close Anaconda, first go to your terminal, then, press 'CONTROL+C' keys, you will see a new line on your terminal:
Anaconda Software Download For Mac Windows 10
Press 'y' key, then press 'RETURN' key. Now your Anaconda is closed :)
Now Anaconda is not running on your terminal. You can press the 'x' on the upper left corner of your terminal window to close the terminal as well.
Success! You've gotten Anaconda and Python working on your Mac!
Success![edit]
You have installed and configured Python. You can move on to the next step.