Setup
Why not work with an existing installation?¶
If you use macOS or Linux, then you most likely already have Python on your computer! Python does not come with Windows, but it may be on your machine as part of other software (e.g. ArcGIS Desktop).
However, unless you've worked with Python already, your pre-existing installation may only include the bare minimum and may be an out of date version. Therefore, we recommend installing a distribution, with Python and many useful add-ons already setup, for all operating systems.
Anaconda or Miniconda¶
We'll install Anaconda or Miniconda depending on the space available on your computer.
Anaconda¶
Anaconda packages the current version of Python 2 or 3 with over 150 packages included in the installation and supports hundreds of others. This includes many of the most heavily used packages supporting data transformation and analysis, and software to manage and add new packages, create virtual environments, and more. Read more here.
The full Anaconda download needs approximately 5GB of space on your computer to download and install.
See Anaconda installation below.
Miniconda¶
If you don't have enough space for Anaconda, you can download Miniconda, which is less than 100 MB. Miniconda includes Python and the same package manager systems as Anaconda, but does not come packaged with any additional packages. You'll need to install them one by one as needed.
See Miniconda installation below.
Alternative: JupyterLite via Jupyter.org¶
If you would like to use Python for the duration of this workshop without downloading anything (or have problems downloading Anaconda), we recommend using JupyterLite. JupyterLite runs completely inside your browser using WebAssembly and Pyodide and provides an identical interface to the JupyterLab IDE we'll be using for the workshop. You can drag and drop files to upload example data later on, and you can right click on any files to download them for later use.
Read more about JupyterLite
Note: If you run into issues with JupyterLite hanging or being unable to run code, try running it in a "Private" browser window, or try clearing your browser cache. This will reset the service, so make sure to save any files you need before clearing the cache!
Alternative: Open OnDemand (UNC Research Computing)¶
If you have access to UNC's Longleaf cluster, you can use Python with the Spyder IDE or Jupyter Lab in a web browser on Research Computing's Open OnDemand service. This service runs on the Longleaf cluster so it's a great option for complex or long-running Python scripts.
Anaconda Installation¶
Select your operating system. Mac Users pay special attention to whether you need the M1 version.
Mac Installation |
PC Installation |
---|---|
Leave the default settings and click through to install. |
1. PATH Do not add Anaconda to your PATH variable. This may interfere with any existing Python-dependent software on your computer. 2. Registering Python If you are installing Python for the first time, select "Register Anaconda as the system Python" If you have Python-dependent software (e.g. ArcGIS, CAD software, etc), do not check "Register Anaconda as the system Python" or it may cause issues. If you're unsure, open your PC's Command Line (Start>Windows System>Command Prompt) or Mac's Terminal (Applications>Utilities>Terminal) and type `python` and press Enter. If you already have Python you should see something like the image below - do not check Register Anaconda as the system Python. |
Miniconda Installation¶
Download and install miniconda
- (Mac Users, be careful of whether or not you need the M1 version).
- Leave the default settings and click through to install, regardless of your operating system.
You will need these additional packages on top of Miniconda:
Mac Package Installation |
PC Package Installation |
---|---|
1. Open Finder > Applications > Utilities > Terminal. Run the following: conda install -c conda-forge jupyterlab When prompted, type `y` to Proceed. This will install Jupyter Lab and all of its dependencies. 2. In the same window, run the following to install conda's graphical interface, Anaconda Navigator. conda install -c anaconda anaconda-navigator When prompted type `y` to Proceed. You can open the Anaconda Navigator from Finder (Mac) or the Start Menu (PC). |
Follow the steps for full Anaconda installation above as appropriate. 1. Open Start Menu > Anaconda3 > Anaconda Prompt. Run the following: conda install -c conda-forge jupyterlab When prompted, type `y` to Proceed. This will install Jupyter Lab and all of its dependencies. 2. In the same window, run the following to install conda's graphical interface, Anaconda Navigator. conda install -c anaconda anaconda-navigator When prompted type `y` to Proceed. You can open the Anaconda Navigator from Finder (Mac) or the Start Menu (PC). |
More Help¶
Further documentation about the installation process is available from Anaconda.
%%HTML
<style type="text/css">
table td, table th, table tr { border: 1px black solid !important; color: black !important; }
table td, table tr {text-align:left !important; font-size:14px; vertical-align:top !important;}
table th {text-align:center !important; font-size:15px; }
</style>
# #convert with the following code in the anaconda prompt:
# jupyter nbconvert Setup.ipynb --TagRemovePreprocessor.enabled=True --TagRemovePreprocessor.remove_input_tags hide-input --to html