Installing Python on your computer
Installing Python on your computer (for Mac, Windows or Linux)
To use Python directly on your computer you'll need to have both Python, the programming language, and a coding editor installed on your computer. The editor is the software you'll use to write and run the code from and we use an editor called PyCharm (Community Edition).
This page will guide you through the process of downloading and installing both Python and the editor. The software we use is free to download and install.
Concise version (for a more detailed guide, go to the section labelled A. Installing Python):
-
Install latest version of Python from http://www.python.org/downloads
-
Install PyCharm Community Edition (NOTE: do not install the Professional Edition) from https://www.jetbrains.com/pycharm/download/ (Mac users: please choose the version that matches your computer's processor)
A. Installing Python
-
Download the latest version of Python 3 from here: http://www.python.org/downloads
-
Once download is complete run the installer by double clicking the downloaded file or clicking Run when prompted to do so.
-
Follow the prompts in the installer. You can choose default options at every stage of the installation.
B. Installing PyCharm Community Edition
-
Download PyCharm Community from here: https://www.jetbrains.com/pycharm/download/. Make sure you choose the Community edition. Do not install the Professional Edition. (Mac users: please choose the version that matches your computer's processor)
-
Once download is complete, run the installer by double clicking the downloaded file or clicking Run when prompted to do so.
-
On a Mac: simply drag the PyCharm icon onto the Applications folder icon.
-
On Windows: Follow the prompts in the installer. Click ‘Yes’ if prompted with “Do you want to allow this app to make changes to your device?"
-
The first time you open PyCharm you will be presented with a few windows - choose the default options. The only exception is the UI (user-interface) theme where we would recommend using the one with a white background.
Setting up PyCharm for the first time
You will get to the Welcome to PyCharm screen (shown below.)
Click on New Project and click the Create button. You should be all set. The students will create one project to use for the whole course.
If there are any red warnings on this page, you can let us know and we can help you make sure everything is fully set up.
C. Checking that everything works
-
Once you have downloaded and installed both Python and PyCharm Community, open PyCharm. If you are greeted with the 'Welcome to PyCharm' window shown above, choose 'New Project'
-
You are now in a PyCharm project. From the File menu choose New… and choose 'Python file' from the menu that appears [please note: do not select the option that simply says 'File'.] Type in any file name.
-
This should bring up a blank file. If you get this far, everything should be working fine. But as a final check copy and paste the following line in the blank file:
-
print("Hello, World!")
-
and choose 'Run' from the Run menu; a window will appear and you can simply click the name of the file you have just created. A window should appear at the bottom of the screen with the words Hello, World!. If you get this far, all is working well, and you have written your first computer program!
Troubleshooting
If you have issues with any part of the installation process, please get in touch and we will assist you in making sure all is set for the course. However, below are a some common issues that may occur during installation.
— While working on a file in PyCharm, a yellow warning bar shows up at the top saying “No Python interpreter configured for the project”. Simply click on the blue link right next to it saying “Configure Python Interpreter”, as shown below:
From the window that comes up you will be able to choose the Python installation from the drop-down menu “Python interpreter”. If there is more than one option choose the latest version of Python 3, as shown below:
If the pull-down Interpreter menu is blank.
-
Click on Project Interpreter in the menu on the left.
-
Then click on the cogwheel icon on the top right, next to the Project Interpreter dropdown menu.
-
Choose 'Add …’.
-
Click on 'System Interpreter’’ in the menu on the left and make sure that the Python listed is version 3
— On Windows PCs, PyCharm may fail to start up, giving an error message. There are two likely reasons for this:
a. You have chosen the wrong option between 32-bit and 64-bit Windows when installing PyCharm. The other version should be installed on your computer. Simply look for it in the folder where PyCharm has been installed and launch the other version.
b. If this does not work, please contact us.
— Some Windows 10 laptops and PCs come with a version of Windows 10 Pro labelled S that only allows you to download applications from the Microsoft store. If you haven't already turned this off, you can do so through the Windows Store - this will allow you to download other software on your computer.