Installation and setup for Python with Miniconda

Note

In the University computer lab you DO NOT have to install Anaconda or Miniconda or any other Python distribution.

If you are attending the course in the University computer lab, please jump to Creating environments and install packages to create the working environment. This section only for general info if you want to install Python on your own computer, and for remote students.

How to start doing GIS with Python on a computer?

Well, first you need to install Python and necessary Python modules that are used to perform various GIS-tasks. The purpose of this page is to help you out installing Python and all those modules into your own computer. Even though it is possible to install Python from their homepage, we highly recommend using Miniconda or Anaconda which is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. In short, it makes life much easier when installing new tools on your Python to play with.

Note

Miniconda is an encapsulated versatile virtual python environment installer, that works under the hood of the big Anaconda python distribution. Miniconda is basically a mini version of Anaconda that includes only the conda package manager and its dependencies!

https://conda.io/miniconda.html

Following steps have been tested to work on Windows 7 and 10 with Anaconda/Miniconda 64 bit.

Download Miniconda installer (64 bit) a Python 3.8/3.9, 64-bit (exe installer) for Windows.

BEWARE:

  • To install miniconda SYSTEM-WIDE for ALL users, this does require administrator permissions; every users can then create their own environments with the conda tool.

  • Please do NOT make Conda the default python for the system if you don’t want it to interfere with other Python installations you might have, eg. Pythons of ArcGIS and QGis etc

Install Miniconda on your computer by double clicking the installer and install it into a directory you want.

Install it to all users and use default settings.

Additional install information: https://conda.io/projects/conda/en/latest/user-guide/index.html

Verifying the installation

Note

As a convention, whenever I demonstrate Python codes or using commands on the the shell/cmd commandline, using the # symbol implies a comment. This line, respectively everything after that symbol is NOT to be executed.

In order to test that the conda package manager works we have to go through a few more steps: After successful installation you should have a menu entry in the Windows Start Menu:

Anaconda Prompt

This is a Windows CMD (Commandline window, that “knows” about, where your Miniconda/Anaconda installation lies, and where to find the conda tool (without interfering other Python installations on your computer). After it opens it should display somehow like so:

(base) C:\Users\Alexander>

or

(C:\dev\conda3) C:\Users\Alexander>

On the command line type command conda --version in order to see if the command is successful, it should show the version of the conda tool.

(base) C:\Users\Alexander> conda --version
conda 4.10.3

Now we have the base conda/Anaconda installation available. The next step is Creating environments and install packages to create a flexible Python working environment.