Installation Guide
The following is a short installation guide for this course. I will generally be assuming access to a unix-style command line.
Note. In the long run, if you are a Windows user, I recommend setting up a WSL environment. This give you a Linux subsystem which will make other CS courses go a lot smoother (in my opinion). If you want something a little simpler, you can set up the Git Bash emulator, which should be sufficient for this course. Follow the instructions at either one of those links.
If you don't do either of these things (e.g., if you want to work directly in PowerShell) then we cannot guarantee we'll able to troubleshoot any issues you might run into.
Setting Things Up
Install the latest release of python from https://www.python.org. Follow the "Downloads" tab to an installer for your operating system. After doing this, you should open up a terminal and run the command
python3
in on the command line to open in interactive Python REPL (Read-Eval-Print-Loop) to verify that everything was set up correctly. You can then type CTL-D to exit the REPL.
The above installation includes a program called `pip3`, which is a package manager for Python. run the following command:
pip3 install sympy numpy scipy matplotlib networkx scikit-learn
This will install all the libraries you need for this course.
- (Optional) Install VSCode.
Working on Python Code
- Open up a
file_name.py
file in your favorite editor and edit the code. In a terminal, navigate to the directory where your Python file is, e.g.,
cd path/to/directory/where/file/is
Run the command
python3 file_name.py
to evaluate the code in that file. If you want to evaluate the file and then go into an interactive Python REPL, then run
python3 -i file_name.py
Tips
You may want to brush up on basic command line usage. Important things to know:
ls
show whats in your current directorypwd
show the path of the directory you're currently incd path/to/directory_name
go to the directory given by the pathrm file
delete file (this cannot be undone! it's not the same as putting in the Trash folder)rm -r directory_name
delete a directory and everything in it (this cannot be undone!)touch file_name
create an empty file calledfile_name
mkdir dir_name
create an empty directory calleddir_name
(Become comfortable with these commands!)
I generally recommend putting all your code for this course in a single directory in, for example, your Documents folder. You can run the command
mkdir -p ~/Documents/CS132-F24
to create this directory. This is equivalent to going to the Documents folder (in Finder for MacOS) and creating a new folder.
- Setting up a machine takes some time (and some tears). But please understand that this is an incredibly important part of being a computer scientist. You have to know how to set up your coding environment.