Welcome to part three of the Smart Data coding course "Python and Social Media Geographic Information", where you'll unlock vital spatial coding skills that will empower your journey and open new horizons. To be able to follow through the chapters of this course, a few technical prerequisites must be followed. In detail, we need to install Python, the coding language we will use, Jupyter Lab/Notebook, our IDE (or integrated development environment) of choice, and a few Python libraries along the way, that can be seen as add-ons to what Python can do with our commands.
💡If you are taking this course directly from the NFDI4Earth educational portal, you will work with a dedicated Jupyter Lab workspace that is already set up with all necessary libraries and data. This means you can bypass installing Python or Jupyter locally on your computer. Instead, simply log into the portal, and you’ll be ready to jump right into the coding. However, if you prefer to set up your own environment for practice or future use, follow the instructions below.
When installing Python and Jupyter Lab (and other packages), you can either use your native system or create a virtual environment, which gives you the ability to create an isolated environment on your machine from where you can start your projects. The big advantage here is that some libraries have dependencies on what is installed and how – and a virtual environment gives you the ability to install or deinstall everything as you go, or just start over if everything goes south. It is therefore recommended that a virtual environment be created and the needed libraries installed there. You can use Anaconda Navigator to do this. It is software you can use to avoid typing commands in a command box but instead manage environments and libraries in an easy-to-use user interface. Visit Anaconda Navigator and its doc for Managing Environments to get more information on how to set up a virtual environment.
Start Anaconda Navigator, click on Environments in the left tab, then on import, and then select the .yml file for your project. Choose a name for the new environment (this will be the name you need for starting it in the command prompt) and click on import. This will take a while to install (approx. 10 minutes depending on your machine and the .yml file). For this course, we provide you with a .yml file (download: smart_data.yml) you can create your venv. In most cases, we advise you to follow this path since fewer issues might occur, watch the video below for a detailed visual guide on these steps.
💡If you want Jupyter Lab or Jupyter Notebook to open in a particular folder (for example, “D:/”), you can add the --notebook-dir
option to your command. This tells Jupyter exactly which folder to use as its starting location. For instance:
jupyter lab --notebook-dir=D:/
jupyter notebook --notebook-dir=D:/
Just replace D:/ with the path you’d like to use on your own computer. This ensures that Jupyter starts in that directory instead of the default one, watch the video below for a detailed visual guide on these steps.
Now that you’ve successfully set up your environment and are ready to work with the tools we’ll use throughout the course, great job! You’re all set to dive into the world of spatial coding. Let’s move on to the next chapter and start learning🥳