Anaconda Python 3

Particular exercises will use Python 3 programs running on your own computer. Python is free and open-source, but some examples will require additional open-source packages beyond the stock Python system. The recommended solution is to use the standard distribution from python.org with a few additional packages, but some users may prefer to use Anaconda Python Individual Edition as it includes more additional packages ‘out of the box.’

The current version of Python is 3.8. For Windows users, the 64-bit version is required.

macOS Installation Notes

  1. Please download the current 64-Bit Graphical Installer from Anaconda Installers. The version we’ll use for Fall 2020 is Anaconda3-2020.07.

  2. Open the .pkg file you downloaded to start the installer.

  3. I recommend permitting the default installation options, which will default to per-user individual installation in your home folder under opt/anaconda3.

  4. You’ll need to accept the license to continue.

  5. Note to command-line users: by default the installer will modify or create your .bash_profile so the Anaconda system will be the default Python in your Terminal windows. You may wish to edit or move this script to suit your tastes, especially if you already have other Python systems in place.

  6. The graphical shell may be launched by opening the Anaconda-Navigator.app from opt/anaconda3 in your home folder.

  7. To try launching an interpreter, please select the Environments tab, locate the default base(root) environment, click the triangular ‘Play’ button and select Open With Python. A console window should launch running an interpreter. The default environment includes many useful third-party packages, so the following should work:

    1. import numpy

    2. import scipy

    3. import PyQt5

  8. Please continue on to the Anaconda Package Configuration instructions.

Anaconda Package Configuration

The default Anaconda systems includes most third-party packages we will need, but there are a few that still need to be installed. The Anaconda package manager ‘conda’ supports multiple ‘environments’, each with a particular set of installed packages. Conda can be fragile and mysteriously fail when packages are added to the base environment, so the first step is to create a second environment for actual use. This will start out with a minimal set of packages to which we’ll add what we need.

  1. Please click the Create button below the list of environments on the Environments tab.

  2. Please enter a short name for the new environment, e.g. rcp, then click Create to confirm.

  3. Packages are available on ‘Channels’. We’ll need to add the conda-forge channel to proceed.

    1. Click on Channels, then Add.

    2. Enter conda-forge

    3. Click on Update Channels.

  4. Now we can start selecting packages for installation. If the package selector is switched to ‘All’ or ‘Not installed’, then the Search Packages field can be used to find specific packages out of the more than 16000 available. Please select the following for installation for now; we may add more later:

    1. scipy

    2. pyqt

    3. paho-mqtt

  5. Please click Apply to proceed, the Apply again to confirm.

  6. Packages may also be installed via pip as in other Python systems. E.g., to install the optional python-rtmidi library:

    1. Use ‘Open Terminal’ with the new environment to launch a console window without actually starting Python.

    2. Enter pip install python-rtmidi

    3. Now within Python, import rtmidi should work.

    4. Also, pydoc rtmidi from the console will show documentation.

macOS De-Installation Notes

With the default installation, all the files are in your home folders. For a complete clean, please first run the following from a Python Terminal window:

  1. conda install anaconda-clean

  2. anaconda-clean --yes

Then you may delete all of opt/anaconda3 from your home directory.