Let’s start with Python
We’re finally here!
But first, let us tell you what Python is. Python is a very popular programming language that can be used for creating websites, games, scientific software, graphics, and much, much more.
Python originated in the late 1980s and its main goal is to be readable by human beings (not only machines!). This is why it looks simpler than other programming languages, but don’t worry – Python is also really powerful!
Python installation
Note If you already worked through the installation steps, there’s no need to do this again – you can skip straight ahead to the next chapter!
For readers at home: this chapter is covered in the Installing Python & Code Editor video.
This section is based on a tutorial by Geek Girls Carrots (https://github.com/ggcarrots/django-carrots)
Django is written in Python. We need Python to do anything in Django. Let’s start by installing it! We want you to install the latest version of Python 3, so if you have any earlier version, you will need to upgrade it. If you already have version 3.10 or higher you should be fine.
Please install normal Python as follows, even when you have Anaconda installed on your computer.
Note Before you install Python on macOS, you should ensure your Mac settings allow installing packages that aren’t from the App Store. Go to System Preferences (it’s in the Applications folder), click “Security & Privacy,” and then the “General” tab. If your “Allow apps downloaded from:” is set to “Mac App Store,” change it to “Mac App Store and identified developers.”
You need to go to the website https://www.python.org/downloads/ and download the latest Python installer:
- Download Python 3.12.3,
- Double click python-3.12.3-macos11.pkg to run the installer.
Verify the installation was successful by opening a command prompt and running the python3 command:
command-line
$ python3 --version
Python 3.12.3
The version shown may be different from 3.12.3 — it should match the version you installed.
If you have any doubts, or if something went wrong and you have no idea what to do next, please ask your coach! Sometimes things don’t go smoothly and it’s better to ask for help from someone with more experience.