Installing Python on your computer

Installing Python on your computer (for Mac, Windows or Linux)

You will need two bits of software to run Python on your computer, both of which are free to download and install. First, you need Python itself (which is the programming language) and then you will need an editor to write and run code - we will be using PyCharm Community.

 

We also use Dropbox file sharing as our part of our course management system.

This is the detailed version of the installation and setup instructions. If you wish to go through a more concise version please click here.

 

A. Installing Python

 

  1. Download the latest version of Python 3 from here: http://www.python.org/downloads

  2. Once download is complete run the installer by double clicking the downloaded file or clicking Run when prompted to do so. [Mac users: you may need to double click twice and ignore the warning message that comes up the first time]

  3. On a Mac: click Continue on all the installer windows.

  4. On Windows:

    1. Untick the option “Install launcher for all users” as we will not need to launch Python directly but through PyCharm (which we will install later).

    2. Tick the option “Add Python 3 to PATH. Then click on "Install Now”

 

B. Installing PyCharm Community Edition

 

  1. Download PyCharm Community from here: https://www.jetbrains.com/pycharm/download/. Make sure you choose the Community edition. Once download is complete, run the installer by double clicking the downloaded file or clicking Run when prompted to do so.

  2. On a Mac: simply drag the PyCharm icon onto the Applications folder icon.

  3. On Windows:

    1. Click ‘Yes’ if prompted with “Do you want to allow this app to make changes to your device?"

    2. Click Next on both the Welcome screen and the ‘Choose Install Location’ screen

    3. On the ‘Installation Options’ screen:

      1. Tick the Create Associations .py check box.

      2. Choose the version that matches your Windows version if you wish to have a shortcut on the desktop. If you are unsure whether you have 32-bit or 64-bit Windows type “32-bit or 64-bit” in the Windows search bar at the bottom left of the screen and the first link will be “See if you have 32-bit or 64-bit version of Windows”; click on it and look for ‘System type’. 

    4. On the 'Choose Start Menu Folder’ we recommend you change ‘JetBrains’ (the name of the company that makes the software) to ‘PyCharm’ to make it easier to find when looking for the software.

  4. The first time you open PyCharm you will be presented with a few windows - choose the default options. The only exception is the UI theme where we would recommend using the one with a white background.

  5. ​Once you get to the “Welcome to PyCharm” screen, please follow the steps below carefully for setting up PyCharm for the first time.

 

IMPORTANT STEP

Setting up PyCharm for the first time

 

​When you get the Welcome to PyCharm screen (shown below):

  1. Click on the ‘Configure’ button at the bottom and choose Preferences (on a Mac) or Settings (on Windows). 

  2. Click on Project Interpreter in the menu on the left.

  3. Then click on the icon on the top right, next to the Project Interpreter dropdown menu.

  4. Choose 'Add …’.

  5. Click on 'System Interpreter’’ in the menu on the left and make sure that the Python listed is version 3 (On a Mac this may default to Python 2, choose the correct version from the dropdown menu). Then click ‘OK’ on both windows (this may take a few seconds while PyCharm loads the correct version of Python.) 

  6. You can now choose Create New Project and you should be all set

​​

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 'Create 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. 

  1. Click on Project Interpreter in the menu on the left.

  2. Then click on the cogwheel icon on the top right, next to the Project Interpreter dropdown menu.

  3. Choose 'Add …’.

  4. 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.