Skip to content

Commit 79d0341

Browse files
authored
Merge pull request #1683 from nikhiljohn10/python3
Python 3 Upgrade
2 parents 78452d2 + 1958088 commit 79d0341

File tree

7 files changed

+22
-21
lines changed

7 files changed

+22
-21
lines changed

book.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"gitbook": ">=3.2.0",
33
"variables": {
4+
"py_version": "3.8",
5+
"py_release": "3.8.6",
6+
"py_min_version": "3.6",
7+
"py_min_release": "3.6.8",
8+
"pa_py_version": "3.8",
49
"django_version": "2.2.4"
510
},
611
"links": {

en/chromebook_setup/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Run:
7474
```
7575
mkdir djangogirls
7676
cd djangogirls
77-
python3.6 -mvenv myvenv
77+
python3 -m venv myvenv
7878
source myvenv/bin/activate
7979
pip install django~={{ book.django_version }}
8080
```

en/deploy/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Deploying a web app on PythonAnywhere involves pulling down your code from GitHu
176176

177177
{% filename %}PythonAnywhere command-line{% endfilename %}
178178
```
179-
$ pip3.6 install --user pythonanywhere
179+
$ pip{{ book.pa_py_version }} install --user pythonanywhere
180180
```
181181

182182
That should print out some things like `Collecting pythonanywhere`, and eventually end with a line saying `Successfully installed (...) pythonanywhere- (...)`.
@@ -185,7 +185,7 @@ Now we run the helper to automatically configure our app from GitHub. Type the f
185185

186186
{% filename %}PythonAnywhere command-line{% endfilename %}
187187
```
188-
$ pa_autoconfigure_django.py --python=3.6 https://github.com/<your-github-username>/my-first-blog.git
188+
$ pa_autoconfigure_django.py --python={{ book.pa_py_version }} https://github.com/<your-github-username>/my-first-blog.git
189189
```
190190

191191
As you watch that running, you'll be able to see what it's doing:

en/django_installation/instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ $ python3 -m venv myvenv
8585
>{% filename %}command-line{% endfilename %}
8686
>```
8787
>$ sudo apt install python-virtualenv
88-
>$ virtualenv --python=python3.6 myvenv
88+
>$ virtualenv --python=python{{ book.py_version }} myvenv
8989
>```
9090
9191
> __NOTE:__ If you get an error like
@@ -99,7 +99,7 @@ $ python3 -m venv myvenv
9999
>
100100
>{% filename %}command-line{% endfilename %}
101101
>```
102-
>sudo apt install python3.6-venv
102+
>sudo apt install python{{ book.py_version }}-venv
103103
>```
104104
105105
<!--endsec-->
Binary file not shown.

en/python_installation/instructions.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
> This section is based on a tutorial by Geek Girls Carrots (https://github.com/ggcarrots/django-carrots)
44
5-
Django is written in Python. We need Python to do anything in Django. Let's start by installing it! We want you to install the latest version of Python 3, so if you have any earlier version, you will need to upgrade it. If you already have version 3.4 or higher you should be fine.
5+
Django is written in Python. We need Python to do anything in Django. Let's start by installing it! We want you to install the latest version of Python 3, so if you have any earlier version, you will need to upgrade it. If you already have version {{ book.py_min_version }} or higher you should be fine.
66

77
Please install normal Python as follows, even when you have Anaconda installed on your computer.
88

@@ -16,19 +16,15 @@ First check whether your computer is running a 32-bit version or a 64-bit versio
1616

1717
You can download Python for Windows from the website https://www.python.org/downloads/windows/. Click on the "Latest Python 3 Release - Python x.x.x" link. If your computer is running a **64-bit** version of Windows, download the **Windows x86-64 executable installer**. Otherwise, download the **Windows x86 executable installer**. After downloading the installer, you should run it (double-click on it) and follow the instructions there.
1818

19-
One thing to watch out for: During the installation, you will notice a window marked "Setup". Make sure you tick the "Add Python 3.6 to PATH" or 'Add Python to your environment variables" checkbox and click on "Install Now", as shown here (it may look a bit different if you are installing a different version):
19+
One thing to watch out for: During the installation, you will notice a window marked "Setup". Make sure you tick the "Add Python {{ book.py_version }} to PATH" or 'Add Python to your environment variables" checkbox and click on "Install Now", as shown here (it may look a bit different if you are installing a different version):
2020

2121
![Don't forget to add Python to the Path](../python_installation/images/python-installation-options.png)
2222

2323
When the installation completes, you may see a dialog box with a link you can follow to learn more about Python or about the version you installed. Close or cancel that dialog -- you'll be learning more in this tutorial!
2424

25-
Note: if you are using an older version of Windows (7, Vista, or any older version) and the Python 3.6.x installer fails with an error, you can try either:
26-
1. install all Windows Updates and try to install Python again; or
27-
2. install an [older version of Python](https://www.python.org/downloads/windows/), e.g., [3.4.6](https://www.python.org/downloads/release/python-346/).
25+
Note: If you are using an older version of Windows (7, Vista, or any older version) and the Python {{ book.py_version }} installer fails with an error, then install all Windows Updates and try to install Python again. If you still have the error, try installing Python version {{ book.py_min_release }} from [Python.org](https://www.python.org/downloads/windows/).
2826

29-
If you install an older version of Python, the installation screen may look a bit different than shown above. Make sure you scroll down to see "Add python.exe to Path", then click the button on the left and pick "Will be installed on local hard drive":
30-
31-
![Add Python to the Path, older versions](../python_installation/images/add_python_to_windows_path.png)
27+
> Django {{ book.django_version }} needs Python {{ book.py_min_version }} or greater, which does not support Windows XP or earlier versions.
3228
3329
<!--endsec-->
3430

@@ -37,10 +33,10 @@ data-collapse=true ces-->
3733

3834
> **Note** Before you install Python on OS X, you should ensure your Mac settings allow installing packages that aren't from the App Store. Go to System Preferences (it's in the Applications folder), click "Security & Privacy," and then the "General" tab. If your "Allow apps downloaded from:" is set to "Mac App Store," change it to "Mac App Store and identified developers."
3935
40-
You need to go to the website https://www.python.org/downloads/release/python-361/ and download the Python installer:
36+
You need to go to the website https://www.python.org/downloads/mac-osx/ and download the latest Python installer:
4137

4238
* Download the *Mac OS X 64-bit/32-bit installer* file,
43-
* Double click *python-3.6.1-macosx10.6.pkg* to run the installer.
39+
* Double click *python-{{ book.py_release }}-macosx10.9.pkg* to run the installer.
4440

4541
<!--endsec-->
4642

@@ -52,10 +48,10 @@ It is very likely that you already have Python installed out of the box. To chec
5248
{% filename %}command-line{% endfilename %}
5349
```
5450
$ python3 --version
55-
Python 3.6.1
51+
Python {{ book.py_release }}
5652
```
5753

58-
If you have a different version of Python installed, at least 3.4.0 (e.g. 3.6.0), then you don't have to upgrade. If you don't have Python installed, or if you want a different version, first check what Linux distribution you are using with the following command:
54+
If you have a different version of Python installed, at least {{ book.py_min_version }} (e.g. {{ book.py_min_release }}), then you don't have to upgrade. If you don't have Python installed, or if you want a different version, first check what Linux distribution you are using with the following command:
5955

6056
{% filename %}command-line{% endfilename %}
6157
```
@@ -108,11 +104,11 @@ Verify the installation was successful by opening a command prompt and running t
108104
{% filename %}command-line{% endfilename %}
109105
```
110106
$ python3 --version
111-
Python 3.6.1
107+
Python {{ book.py_release }}
112108
```
113-
The version shown may be different from 3.6.1 -- it should match the version you installed.
109+
The version shown may be different from {{ book.py_release }} -- it should match the version you installed.
114110

115-
**NOTE:** If you're on Windows and you get an error message that `python3` wasn't found, try using `python` (without the `3`) and check if it still might be a version of Python that is 3.4.0 or higher. If that doesn't work either, you may open a new command prompt and try again; this happens if you use a command prompt left open from before the Python installation.
111+
**NOTE:** If you're on Windows and you get an error message that `python3` wasn't found, try using `python` (without the `3`) and check if it still might be a version of Python that is {{ book.py_min_version }} or higher. If that doesn't work either, you may open a new command prompt and try again; this happens if you use a command prompt left open from before the Python installation.
116112

117113
----
118114

en/python_introduction/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ We want to open up a Python console, so type in `python` on Windows or `python3`
1919
{% filename %}command-line{% endfilename %}
2020
```
2121
$ python3
22-
Python 3.6.1 (...)
22+
Python {{ book.py_release }} (...)
2323
Type "help", "copyright", "credits" or "license" for more information.
2424
>>>
2525
```

0 commit comments

Comments
 (0)