Skip to content

Commit 5148c6c

Browse files
authored
Merge pull request #2 from stanfordpython/2021_revisions
Revise install handouts for 2021 course offering
2 parents 313539a + 5ffe9ef commit 5148c6c

File tree

3 files changed

+95
-360
lines changed

3 files changed

+95
-360
lines changed

installing-python-linux.md

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,17 @@ In this course, you'll be writing lots of Python code, so it's important to get
1010

1111
Throughout this document, we will:
1212

13-
1. Install Python 3.8.0
13+
1. Install Python 3.9.2
1414
2. Create a virtual environment using this version of Python.
1515
3. Inside this environment, install useful packages.
1616

17-
This approach works well and is straightforward to set up, but has its drawbacks. For those who feel more comfortable with the command line, we also provide instructions for a better solution involving a tool named `virtualenvwrapper`. In this portion, we will
18-
19-
1. Reset our environment to the default state.
20-
2. Use Python 3.8.0's `pip` to install `virtualenvwrapper`
21-
3. Use `virtualenvwrapper` to create a managed virtual environment.
22-
4. Inside this environment, install useful packages.
23-
5. Modify the shell startup script to activate this virtual environment.
24-
2517
Let's get started!
2618

2719
## Prerequisite
2820

2921
We assume that you have a basic familiarity with the command line. We understand that not everyone will feel comfortable with the command line, because it is covered starting in CS107. However, I highly recommend using Nick Troccoli's amazing [CS107 resources](https://web.stanford.edu/class/archive/cs/cs107/cs107.1194/resources/) for this quarter if you feel less experienced, particular the section titled "Common Unix Commands."
3022

31-
## Install Python 3.8.0
23+
## Install Python 3.9.2
3224

3325
On different Linux systems, there are a couple of different ways to install and manage packages. We'll cover `apt-get` here, as well as how you can install from source.
3426

@@ -39,25 +31,25 @@ On different Linux systems, there are a couple of different ways to install and
3931
```
4032
$ sudo add-apt-repository ppa:deadsnakes/ppa
4133
$ sudo apt-get update
42-
$ sudo apt-get install python3.8
43-
$ sudo apt-get install python3.8-venv
34+
$ sudo apt-get install python3.9
35+
$ sudo apt-get install python3.9-venv
4436
```
4537

46-
On Debian, we'll just have to `sudo apt-get install python3` and hope for the best. Also note that this might install a different version of Python 3.8, but we won't worry about that here.
38+
On Debian, we'll just have to `sudo apt-get install python3` and hope for the best. Also note that this might install a different version of Python 3.9, but we won't worry about that here.
4739

4840
### Installing with `yum` (RedHat, CentOS)
4941

5042
Other Linux distributions use a different package manager, `yum`. We don't have any test devices with these Linux distributions, so you're on your own here. There is a reasonably good tutorial for CentOS [here](https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7).
5143

5244
### Other Linux package managers
5345

54-
The world of Linux distributions is unfathomably large. If you can pull off a Python 3.8 install on your distribution of choice, more power to you. However, we recommend building from source.
46+
The world of Linux distributions is unfathomably large. If you can pull off a Python 3.9 install on your distribution of choice, more power to you. However, we recommend building from source.
5547

5648
### Installing from source
5749

5850
Installing Python from source follows the same pattern as most other source installations.
5951

60-
First, download the source tarball (either [gzipped](https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz) or [XZ compressed](https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tar.xz)). Unzip the files and `cd` into the unzipped directory.
52+
First, download the source tarball (either [gzipped](https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz) or [XZ compressed](https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tar.xz)). Unzip the files and `cd` into the unzipped directory.
6153

6254
To build Python, just execute the usual commands:
6355

@@ -76,11 +68,5 @@ More information on the actual installation process can be found in the tarball'
7668

7769
From here, the instructions are almost exactly the same as the [macOS](https://github.com/stanfordpython/python-handouts/blob/master/installing-python-macos.md) instructions. Follow those instructions, with the following differences.
7870

79-
### Finding `virtualenvwrapper.sh`
80-
81-
If you choose to use `virtualenvwrapper`, it will be installed in a platform-specific location. You will need to find this file. You can use the `find` command described in the linked document to search your computer for the downloaded file.
82-
83-
If other unexpected differences come up between those instructions and your operating system, please let us know on Piazza so that we can update these instructions with distribution-specific dependencies.
84-
8571
## Credit
8672
Much of this handout was based on a similar handout written by Sam Redmond (@samredmond)

0 commit comments

Comments
 (0)