**CS1 Installation instructions** Make sure to follow the instruction specific to your operating system below. # On Windows You will install all of the following: - Python 3.7.4 ([Dowload link](https://www.python.org/ftp/python/3.7.4/python-3.7.4.exe)) - PyQt5 - PyCharm IDE ([Download link](https://www.jetbrains.com/pycharm/download)) - The CS 1 library ([Download link](../install/cs1lib.py)) Here is a video to guide you through [the installation process on your Windows machine](https://dartmouth.zoom.us/rec/share/_ZBaIKz330dIHaPruWjdZYoKDtjAaaa81SUb8_MKmhpY9Ju6mqfW2Joc1nRNKxVW). # On Mac You will install a bunch of software. Check with a TA if you run into trouble. !!! Warning **You should be running a recent version of MacOS, preferably 10.13 or higher. You can check which version you are running using "about this mac" menu option the apple symbol menu on the top left of your screen.** (##) cs1lib Download the file [`cs1lib.py`](../install/cs1lib.py) file and put it on your Desktop. (##) Install python3 and related software * Download a python **stable** version that is suitable for your version of Mac OS from [here](https://www.python.org/downloads/mac-osx/). Make sure it is python3.6 and above and was released after July 2020. Click on the .pkg file downloaded and follow the prompt to install Python3. * Download community version of PyCharm installation file by clicking [here](https://www.jetbrains.com/pycharm/download/). Open Terminal application from Applications > Utilities. Type the following into the Terminal window, pressing return and waiting for the command to complete after each line (make sure you have cs1lib.py on you Desktop): ~~~ pip3 install pyqt5 cd ~/Desktop python3 cs1lib.py ~~~ If all goes well, you should see a window pop up with some graphics, including a small ball moving from left to right, and some text saying "Hello, World!" (##) Install 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](https://www.jetbrains.com/pycharm/download). 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 that is downloaded is pycharm-community-2020.3.5.dmg. If it doesn't open automatically, double-click on it to open it. (It might be in your *Downloads* folder.) Do just what it tells you: drag the icon on the left into the folder on the right. Because you'll be running PyCharm often, you want to add it to the dock. Open your *Applications* folder from the Finder. One way is to choose it from the Finder's *Go* menu. Another way is, in the Finder, type command-shift-A. With the *Applications* folder open, find the *PyCharm CE* icon, and drag it to where you want it in the dock. Run PyCharm, by clicking on the icon in the dock. If your Mac does not have Java installed (unlikely, but possible), then you'll see a window reading *To open "PyCharm" you need to install the legacy Java SE 6 runtime*. If you get this message, click *More Info...*, which will take you to the Apple site. Download and install Java, following the prompts. After PyCharm opens, click *Open* and then click whatever makes sense to you (you might see some choices about keyboards and such) until you get to a window that gives you a choice of creating a new project. If you are asked about importing settings, do not import settings, (unless you've used PyCharm before and have prior settings to import). Click *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.) Then, click on the triangle next to *Project Interpreter*. Click on the radio button next to *Existing Interpreter* and then on the three dots to the right of *Interpreter:*. On the left side, click on *System Interpreter*. * If next to *Interpreter:*, you see */usr/local/bin/python3* or */usr/local/bin/python3.7*, just click *OK*. * Otherwise, you should click the three dots to the right and then type in `/usr/local/bin/python3` and click *OK* twice. (In other words, click *OK* and you'll get another *OK* button to click.) Either way, click *Create*. When you create projects in the future, you should by default get the right Python interpreter without going through all of these steps. You're going to put the file `cs1lib.py` into the project you made in PyCharm (*cs1proj* in my case). *With either the option key or the control key pressed*, drag the *cs1lib.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 option or 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 the *Run* menu shows *Run 'cs1lib'*, you can just select that. * From the *Run* menu, select *Run ...*, and then from the window that pops up, select *cs1lib*. (Ignore the number that appears next to it.) * In the *Project* tab, *right-click* on *cs1lib.py* and then select *Run 'cs1lib'* from the popup menu. 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.