For this class you will need Python 3, Jupyter, and some other Python packages. I highly recommend installing Anaconda, which is a Python distribution that contains everything you need. It is easy to install on Windows, Mac, and Linux, and because it does a user-level install, it does not interfere with other Python installations.
Information about installing Anaconda is here.
When you install Anaconda, you might get Jupyter by default, but if not, run
conda install jupyter
Code for the class is in a Git repository on Github. To work with this code, you should fork it on GitHub and then clone it to your laptop.
1) To fork the repository, go to https://github.com/AllenDowney/ThinkComplexity2 and click on the Fork button in the upper right. If you don't already have a GitHub account, you will have to create one. Since your work on GitHub may become part of your professional portfolio, you might want to choose a user name you can keep for a long time.
After forking, you should have a repository on GitHub with the URL https://github.com/YourGitHubUserName/ThinkComplexity2
2) To clone your repository, you need a Git client. If you don't already have one, you can use a command-line client or a graphical client like Github Desktop. On Ubuntu, you can install the command-line client by running
sudo apt install git
Then you should be able to clone your repository by running:
git clone --depth 1 https://github.com/YourGitHubUserName/ThinkComplexity2
It should create a directory named ThinkComplexity2.
3) To start Jupyter, run:
cd ThinkComplexity2
jupyter notebook
Jupyter should launch your default browser or open a tab in an existing browser window. If not, the Jupyter server should print a URL you can use. For example, when I launch Jupyter, I get
~/ThinkComplexity2$ jupyter notebook
[I 10:03:20.115 NotebookApp] Serving notebooks from local directory: /home/downey/ThinkComplexity2
[I 10:03:20.115 NotebookApp] 0 active kernels
[I 10:03:20.115 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 10:03:20.115 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
In this case, the URL is http://localhost:8888. When you start your server, you might get a different URL. Whatever it is, if you paste it into a browser, you should should see a home page with a list of the notebooks in the repository.
Click on chap06.ipynb. It should open the notebook for Chapter 6.
Select the cell with the import statements and press "Shift-Enter" to run the code in the cell. If it works and you get no error messages, you are all set.
If you get error messages about missing packages, you can install the packages you need using your package manager.
Git Work Flow
The following diagram shows most of what you will need to work with Git for this class
1) To create your repository on GitHub, press the Fork button on the home page for my repository.
2) To create a local copy of your repository on your laptop, clone your repo.
3) After you make changes, push them from your laptop to your repo.
4) If I make changes in my repo after you press fork, you have to tell Git that my repository is upstream from yours:
git remote add upstream https://github.com/AllenDowney/ThinkComplexity2
Then you can pull my changes into your local copy like this:
git pull upstream master