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:
- Requirements: gather everything you will need before getting started
- Miniconda Install: install the programme that will allow you to install Python
- GDS Environment: turbo charge your Python installation
- Extra addon’s: put the final touches on the install
- 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:
- Right-click on the link to each file and select “Save link as”
- A copy of Miniconda for Windows and Python 3.8. Make sure you check which architecture of Windows you are running before proceeding.
TIP:
To download Miniconda, follow these steps:
- Head over to the Download Page and select Python 3.8:
- 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).
- 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:
- Head over to the folder where you downloaded it (the Desktop in our case)
- Double click the downloaded file will open an installation window:
- Click Next on the first step.
- Click I Agree to the Terms and Conditions:
5. In the next window, we will select “Just Me” so no administrator rights are required:
- 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:
- 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).
- Click Install and the installation process will begin:
- Once the installation is complete, click Next.
- 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!
- Head to the Windows icon on the bottom left of your screen and type Anaconda:
- Now click on Anaconda Prompt (miniconda3) (from now on we will refer to this as the Anaconda Prompt)
- This will launch a window that looks, more or less, like this:
- Now we need to “navigate” to the folder where you placed the
jl_setup.bat
file. 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.
- 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!
- 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.
- 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!
- 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 readsbase
, activate thegds
environment by running:
conda activate gds
You can see that the start of the line has changed from (base) to (gds).
- 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:
- 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.
- 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:
- Start by opening an Anaconda Prompt (remember: “Start Menu” –> “Anaconda Prompt (miniconda3)”).
- Navigate to the folder that you want to work in using the
cd
command (for example, your home directory:C:\Users\username
). - Activate the GDS environment by running:
conda activate gds
- 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:
- Close the window that opens automatically
- 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!!!