How to install the CS 1 software on Windows

This page shows you how to install the CS 1 software on your PC. You will install all of the following:

Installing Python 3.7.4

Download the Python 3.7.4 executable file from here.

Click on the executable file and choose Customize installation. This will let you choose the folder in which you want to install Python 3.7.4. Keep the default selection for features to be installed and click on Next.

Choose the folder in which you would like to install Python 3.7.4, and enter it under Customize install location. Make a note of this folder name, because you will need to install pyqt5 in the same folder. For example, if your user name is gracehopper, you might name the folder C:. You can choose any folder name you want. You don’t need to create the Python374 folder, because the installation creates the folder and installs all the Python 3.7.4 files in it. The options Associate files with Python and Create shortcuts for installed applications should be checked. Click on Install. If everything goes well, you will see a success message, and you can click on Close.

Installing PyQt5

Click here and then click on the Download button. Double-click on the file that you download.

Click on Next >, then on I Agree, and then on Next >. You should automatically see the path where you have installed Python 3.7.4. If not, then enter the path where you installed Python 3.7.4. Click on Install. Once the installation is complete, click on Finish.

Installing PyCharm

PyCharm is the name of the software program you will use to type in your Python programs and run them. Download it by clicking here. If you see a window that asks you to give your email address, name, and organization, you don’t need to fill it out.

The file pycharm-community-2019.2.2.exe will automatically get saved to your Downloads folder (or wherever you download it to). Double-click on the downloaded file.

You’ll see a setup screen. Click Next >.

You will be asked to choose an installation directory. You can just use the default and click Next >. Then you’ll get a screen for installation options, and you can just click Next > again. Finally, click Install.

When installation completes, make sure that Run PyCharm Community Edition is selected and click Finish.

The next window asks you about importing settings. Do not import settings, (unless you’ve used PyCharm before and have prior settings to import).

Click on OK again in the initialization screen. PyCharm is now fully installed! Select Create New Project.

The first line of the dialog should ask for a location. The text “untitled” after the last slash is the name of your project. Change it to something that you’ll remember as relevant to this course, for example, cs1proj. (Leave the text before that last slash the same.)

You need to replace whatever you see next to Interpreter by the correct location of your Python interpreter. To do so, click on the gear symbol and select the Add Local option from the dropdown menu. This should automatically take you to your Python 3.7.5 installation. But if doesn’t, then browse to the location of your Python 3.7.4 installation from earlier. In that directory, find python.exe and select it.

Once the Python interpreter is established, click on Create. You have successfuly created your first project. If a Tips window pops up you can close it.

The CS 1 library, including graphics software

Download the file cs1lib.py, and put it on your Desktop. (Unzip it from the zip file.) You’re going to put the file cs1lib.py into the project you made in PyCharm (cs1proj in my case). With the control key pressed, drag the cs1proj.py icon from the Desktop to where it says cs1proj (or whatever project name you chose) in the Project tab of your PyCharm window. Click OK.

The reason that you need to hold the control key down when dragging is that if you don’t, then you’re moving the file, and not copying it, into the project. That means the PyCharm project will be the only place where you have the file. If you screw it up, you’ve screwed up your only copy. So get into the habit of holding the option or control key down while dragging files into PyCharm. If you don’t, then the window you see will say Move file instead of Copy file.

You are going to run cs1lib.py. You have a few choices how to do so:

If all went well, you will see the graphics window with the moving circle and “Hello World”.

At this point, you have a working version of PyCharm that will enable you to run Python programs.