Windows 10 Home/pre-10

This guide covers the installation of Python on machines running Windows 10 Home Edition or versions of Windows prior to Windows 10 (e.g. Windows 7). With this approach, you will install Python “natively,” that is running directly on your operating system.

TIP:

If you are unsure what version of Windows you are running, please check out this guide first.

Installation

This process involves a few steps:

  1. Requirements: gather everything you will need before getting started
  2. Miniconda Install: install the programme that will allow you to install Python
  3. GDS Environment: turbo charge your Python installation
  4. Extra addon’s: put the final touches on the install
  5. Success check: certify everything went smoothly

Make sure you complete each of them successfully before moving on to the next one.

Requirements

To complete this installation route successfully, you will need the following:

  • A good internet connection
  • The jl_setup.bat file that you can download on this link. Right click and “Save Link As” to download it to your computer, as illustrated in the blue box below.

TIP:

To download these files, follow these steps with each:

  1. Right-click on the link to each file and select “Save link as”

TIP:

To download Miniconda, follow these steps:

  1. Head over to the Download Page and select Python 3.8:

  1. We are using Python 3.8, so depending on which windows version you are using (32-bit or 64-bit), click on the relevant file in the Python 3.8 section (highlighted in red).
  2. This will download the Miniconda installation file. Depending on your setup and browser, you will need to select where to place it (the Desktop folder would be a good option) or it will go straight into a default location (e.g. the Downloads folder)

For the sake of this guide, we will assume you download the jl_setup.bat file and the Miniconda installer on the Desktop folder (C:\Users\username\Desktop). You do not need to choose this folder but, if you use a different one, please adjust all instructions below accordingly.

Minicoda Install

The next step is to install the copy of Miniconda we just downloaded. To do that, follow these steps:

  1. Head over to the folder where you downloaded it (the Desktop in our case)
  2. Double click the downloaded file will open an installation window:

  1. Click Next on the first step.
  2. Click I Agree to the Terms and Conditions:

5. In the next window, we will select “Just Me” so no administrator rights are required:

  1. The next window will ask you where to install Miniconda. Unless you know what you are doing, leave the path (highlighted in blue) as is and click next:

  1. The next window can be used for an advanced setup. Unless you know what you are doing, leave the default settings as they are (ie. box ticked at Register Miniconda3 as my default Python 3.8).

  1. Click Install and the installation process will begin:

  1. Once the installation is complete, click Next.
  2. Untick all boxes in the window (unless you want further information on Miniconda, which will open in your browser) and click Finish:

Install GDS Environment

Once we have Miniconda ready to go, the next step is to install what we will call the GDS environment. This is a set of software packages that will allow us to do very cool stuff with Python and geographic data. This is the step that will install most of what you will need and hence also the longest one. Let’s get started!

  1. Head to the Windows icon on the bottom left of your screen and type Anaconda:

  1. Now click on Anaconda Prompt (miniconda3) (from now on we will refer to this as the Anaconda Prompt)

  1. This will launch a window that looks, more or less, like this:

  1. Now we need to “navigate” to the folder where you placed the jl_setup.batfile. In this illustration, we are using the Desktop folder, so you can run the following command:
cd Desktop

Note that you can move to a given folder by using the command cd myFolder to move forward through folders, and cd .. to move backwards. Once you have typed the command, press Enter.

  1. Once you have navigated to the location of your files (e.g. Desktop), run the following command in the Anaconda Prompt, and press enter to execute it:
conda-env create -f https://github.com/darribas/gds_env/raw/v6.1/gds_py/gds_py.yml

TIP:

This step will take a while, depending on the speed of your connection but no less than 15-20 minutes. Grab a cuppa and be patient!

  1. If everything has gone according to plan, your Anaconda Prompt should look a bit like this:

This has created correctly the gds environment, congratulations! We are almost there.

  1. Now we need to activate the environment. For this, run the following command:
conda activate gds

Complete environment Setup

The final step involves installing a few addon’s that will make interacting with data a lot smoother and fun. Let’s get to it!

  1. Ensure you have the gds environment activated. You will be able to check this by looking at the name that appears in parenthesis in the beginning of the last line of the Anaconda Prompt. If yours reads base, activate the gds environment by running:
conda activate gds

You can see that the start of the line has changed from (base) to (gds).

  1. On this very Anaconda Prompt window, let’s run the jl_setup.bat script. For this type the following:
jl_setup.bat

And hit enter. Your Anaconda Prompt should display a series of commands that looks, more or less, as follows:

TIP:

This step requires that jl_setup.bat exists in the same folder C:\Users\username\Downloads and will also take a while, depending on the speed of your connection but no less than 10-15 minutes. Be patient, we’re almost there!

When this completes, you are all set to go, congratulations!!!

NOTE: Do not close the Anaconda prompt yet as we will need it again in the next section, to check everything is alright.

Check Installation

To make sure that your installation was successful and all packages have been installed we need to run one more thing. Here’re the steps to follow:

  1. Download the check_py_stack.ipynb file by right clicking on it and selecting Save link as. Make sure to use the same folder we have been using so far.
  2. From the same Anaconda Prompt as above, with the environment activated (you’ll know that is the case if (gds) is at the top of the line in the command prompt), run:
jupyter nbconvert --to html --execute check_py_stack.ipynb

This will take a little bit and, if it succeeds, it will produce a file called check_py_stack.html that you can open in your browser to inspect. If there are no errors and every cell has been run correctly, your resulting file should look like this one. If the two look the same, you are all set!!!

Running Python

Now that you have successfully installed Python on your computer, you are ready to go! Now every time you want to launch the app, called Jupyter Lab, you will need to follow these steps:

  1. Start by opening an Anaconda Prompt (remember: “Start Menu” –> “Anaconda Prompt (miniconda3)”).
  2. Navigate to the folder that you want to work in using the cd command (for example, your home directory: C:\Users\username).
  3. Activate the GDS environment by running:
conda activate gds
  1. Launch Jupyter lab by running the following command:
jupyter lab

This will launch Jupyter Lab in your default browser.

TIP:

It is recommended to use Firefox or Chrome.

If your default browser is neither of the recommended, you can:

  1. Close the window that opens automatically
  2. Open Firefox/Chrome and paste the URL from the Anaconda Prompt:

You should now be looking at an interface that looks very similar to this:

If that is the case, CONGRATULATIONS!!! You are ready to go and start hacking away!!!