You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: installing-python-linux.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ In this course, you'll be writing lots of Python code, so it's important to get
10
10
11
11
Throughout this document, we will:
12
12
13
-
1. Install Python 3.9.2
13
+
1. Install Python 3.10.3
14
14
2. Create a virtual environment using this version of Python.
15
15
3. Inside this environment, install useful packages.
16
16
@@ -20,7 +20,7 @@ Let's get started!
20
20
21
21
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.1214/resources/) for this quarter if you feel less experienced, particular the section titled "Common Unix Commands."
22
22
23
-
## Install Python 3.9.2
23
+
## Install Python 3.10.3
24
24
25
25
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.
26
26
@@ -31,25 +31,25 @@ On different Linux systems, there are a couple of different ways to install and
31
31
```
32
32
$ sudo add-apt-repository ppa:deadsnakes/ppa
33
33
$ sudo apt-get update
34
-
$ sudo apt-get install python3.9
35
-
$ sudo apt-get install python3.9-venv
34
+
$ sudo apt-get install python3.10
35
+
$ sudo apt-get install python3.10-venv
36
36
```
37
37
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.
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.10, but we won't worry about that here.
39
39
40
40
### Installing with `yum` (RedHat, CentOS)
41
41
42
42
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).
43
43
44
44
### Other Linux package managers
45
45
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.
46
+
The world of Linux distributions is unfathomably large. If you can pull off a Python 3.10 install on your distribution of choice, more power to you. However, we recommend building from source.
47
47
48
48
### Installing from source
49
49
50
50
Installing Python from source follows the same pattern as most other source installations.
51
51
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.
52
+
First, download the source tarball (either [gzipped](https://www.python.org/ftp/python/3.10.3/Python-3.10.3.tgz) or [XZ compressed](https://www.python.org/ftp/python/3.10.3/Python-3.10.3.tar.xz)). Unzip the files and `cd` into the unzipped directory.
Copy file name to clipboardExpand all lines: installing-python-windows.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,15 +30,15 @@ Once you're in the `bash` shell, you can follow the [Linux](https://github.com/s
30
30
```
31
31
$ sudo add-apt-repository ppa:deadsnakes/ppa
32
32
$ sudo apt-get update
33
-
$ sudo apt-get install python3.9
34
-
$ sudo apt-get install python3.9-venv
33
+
$ sudo apt-get install python3.10
34
+
$ sudo apt-get install python3.10-venv
35
35
```
36
36
37
37
You can check which version of Python you've installed by running:
38
38
39
39
```
40
40
$ python3 --version
41
-
Python 3.9.2
41
+
Python 3.10.3
42
42
```
43
43
44
44
In broad strokes, you will need to run the following commands to set up a virtual environment. The Linux and macOS handouts contain more detailed information.
@@ -60,7 +60,7 @@ Working with Windows is complicated enough, so we're going to omit the instructi
60
60
61
61
Recall that we discourage this option as it is very complex and hard for us to debug. Only use this option if the above fails and you don't want to use a VM (Strategy 3) for some reason.
62
62
63
-
You will need Windows 8.1 or newer to use Python 3.9.2 on Windows.
63
+
You will need Windows 8.1 or newer to use Python 3.10.3 on Windows.
64
64
65
65
When in doubt, the source of truth for Windows commands is [included in the Python documentation](https://docs.python.org/3/using/windows.html), and you can find more details on using virtual environments [here](https://docs.python.org/3/library/venv.html#module-venv).
66
66
@@ -70,13 +70,13 @@ The rough outline is:
70
70
2. Create a virtual environment.
71
71
3. Use `pip` to install useful packages.
72
72
73
-
First, download the web-based installer from the [Python 3.9.2 releases page](https://www.python.org/downloads/release/python-392/), either for [x86-64](https://www.python.org/ftp/python/3.9.2/python-3.9.2-amd64-webinstall.exe) or [x86](https://www.python.org/ftp/python/3.9.2/python-3.9.2-webinstall.exe). The web-based installer is a small download which will connect to the internet to download any additional required components, so make sure that you are connected to the internet for the remainder of these installation instructions.
73
+
First, download the web-based installer from the [Python 3.10.3 releases page](https://www.python.org/downloads/release/python-392/), either for [x86-64](https://www.python.org/ftp/python/3.10.3/python-3.10.3-amd64-webinstall.exe) or [x86](https://www.python.org/ftp/python/3.10.3/python-3.10.3-webinstall.exe). The web-based installer is a small download which will connect to the internet to download any additional required components, so make sure that you are connected to the internet for the remainder of these installation instructions.
74
74
75
-
Start the installer. You will see two options: "Install launcher for all users (recommended)" and "Add Python 3.9 to PATH". Make sure both are selected, and then click "Install Now."
75
+
Start the installer. You will see two options: "Install launcher for all users (recommended)" and "Add Python 3.10 to PATH". Make sure both are selected, and then click "Install Now."
76
76
77
77
*Note: Technically, you should also [remove the MAX_PATH limitation](https://docs.python.org/3/using/windows.html#removing-the-max-path-limitation), but we'll skip that for now.*
78
78
79
-
Follow the on-screen instructions to finish installing Python. When you are given the option of unchecking any 'optional' components, do not uncheck any. In particular, if there is an option called "Add python.exe to search path" on the "Customize Python 3.9" screen, make sure that box is checked! You should also see that `pip` is being installed by default.
79
+
Follow the on-screen instructions to finish installing Python. When you are given the option of unchecking any 'optional' components, do not uncheck any. In particular, if there is an option called "Add python.exe to search path" on the "Customize Python 3.10" screen, make sure that box is checked! You should also see that `pip` is being installed by default.
80
80
81
81
Let's check to see that everything was installed correctly.
82
82
@@ -89,21 +89,21 @@ Open up PowerShell or `cmd.exe` and run the following from a command prompt:
89
89
You should see something like the following:
90
90
91
91
```
92
-
Python 3.9.2 (v3.9.2:1a79785e3e, Feb 19 2021, 09:06:10)
92
+
Python 3.10.3 (v3.10.3:1a79785e3e, Feb 19 2021, 09:06:10)
93
93
[Clang 6.0 (clang-600.0.57)] on darwin
94
94
Type "help", "copyright", "credits" or "license" for more information.
95
95
>>>
96
96
```
97
97
98
-
Ensure that the Python version above looks like 3.9.2.
98
+
Ensure that the Python version above looks like 3.10.3.
99
99
100
100
If that doesn't work, try running:
101
101
102
102
```
103
103
> python
104
104
```
105
105
106
-
If this drops you into a Python 3.9.2 interactive interpreter, great! In this case, everywhere you see `python3` below, replace it with the command `python`.
106
+
If this drops you into a Python 3.10.3 interactive interpreter, great! In this case, everywhere you see `python3` below, replace it with the command `python`.
107
107
108
108
If this didn't work, try running:
109
109
@@ -116,16 +116,16 @@ If this worked, then everywhere you see `python3` below, replace it with the com
116
116
Try writing some Python in the interactive interpreter! When you're done, you can exit the interactive interpreter with `CTRL+C` or by entering `quit()` at the Python command prompt.
117
117
118
118
### Checking `pip`
119
-
First, let's check that we have `pip` installed. For CS41, we'll be using a package manager called `pip` to install and manage Python software packages. By default, Python 3.9.2 ships with a version of `pip` prebuilt. `pip` interacts very well with PyPI (the Python Package Index), so we'll be using `pip` extensively this quarter.
119
+
First, let's check that we have `pip` installed. For CS41, we'll be using a package manager called `pip` to install and manage Python software packages. By default, Python 3.10.3 ships with a version of `pip` prebuilt. `pip` interacts very well with PyPI (the Python Package Index), so we'll be using `pip` extensively this quarter.
120
120
121
121
At a command prompt, run the following code. You should see something like the following output:
122
122
123
123
```
124
124
> python3 -m pip --version
125
-
pip 21.0.1 from /pip 21.0.1 from C:\Users\Parth\AppData\Local\Programs\Python\Python38\lib\site-packages (python 3.9)
125
+
pip 21.0.1 from /pip 21.0.1 from C:\Users\Parth\AppData\Local\Programs\Python\Python38\lib\site-packages (python 3.10)
126
126
```
127
127
128
-
Problems might arise if you had a different version of Python 3 already installed, but if you added Python 3.9 to your PATH, this should work.
128
+
Problems might arise if you had a different version of Python 3 already installed, but if you added Python 3.10 to your PATH, this should work.
0 commit comments