aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar discretegames <[email protected]>2022-11-08 05:01:40 -0800
committerGravatar discretegames <[email protected]>2022-11-08 05:01:40 -0800
commitc7f37e9be5244a15bc35451e34975761b472fc54 (patch)
treeb62ae8f34a3ef83e822cbdc984b5a5fd0be46c41
parentAdded WSL2 section to windows guide; other tweaks (diff)
Proofread windows guides and added image links everywhere
-rw-r--r--pydis_site/apps/content/resources/guides/python-guides/windows/installing-and-using-python.md87
-rw-r--r--pydis_site/apps/content/resources/guides/python-guides/windows/microsoft-store.md12
-rw-r--r--pydis_site/apps/content/resources/guides/python-guides/windows/putting-python-on-path.md108
-rw-r--r--pydis_site/apps/content/resources/guides/python-guides/windows/unix-env-on-windows.md2
-rw-r--r--pydis_site/static/images/content/python-on-windows/py_launcher.png (renamed from pydis_site/static/images/content/python-on-windows/py_launcher_1.png)bin11136 -> 11136 bytes
5 files changed, 111 insertions, 98 deletions
diff --git a/pydis_site/apps/content/resources/guides/python-guides/windows/installing-and-using-python.md b/pydis_site/apps/content/resources/guides/python-guides/windows/installing-and-using-python.md
index 86a2e571..f2ad0a2f 100644
--- a/pydis_site/apps/content/resources/guides/python-guides/windows/installing-and-using-python.md
+++ b/pydis_site/apps/content/resources/guides/python-guides/windows/installing-and-using-python.md
@@ -6,7 +6,7 @@ toc: 3
---
Our recommended way of installing Python on a Windows operating system is using the full installer from the official
-[python.org Downloads page](https://www.python.org/downloads/) (the main yellow button) using the default options,
+[python.org Downloads page](https://www.python.org/downloads/) (hit the big yellow button) using the default options,
except making sure to check the "Add python.exe to PATH" checkbox. Getting Python from the [Microsoft
Store](https://apps.microsoft.com/store/search/python) is _not_ recommended as [it can cause various
issues](../microsoft-store).
@@ -17,12 +17,12 @@ finally wraps up by explaining some common Windows-specific Python usage, namely
and how to work with [virtual environments](#virtual-environments).
You may also want to check out our guides on [Common Issues Using Python on Windows](../common-issues), [Adding Python
-to the Windows Path](../putting-python-on-path.md), and Setting up a [Unix-Style Environment on
+to the Windows Path](../putting-python-on-path.md), and [Setting up a Unix-Style Environment on
Windows](../unix-env-on-windows.md).
## Recommended Install
-Follow the steps below to install the latest version of Python on Windows.
+Follow the five steps below to install the latest version of Python on Windows.
(The instructions were written with Windows 10 and Python 3.11.0 in mind, but should be nearly or fully identical with
Windows 11 or other modern versions of Python.)
@@ -42,12 +42,13 @@ Windows 11 or other modern versions of Python.)
[![Step 1](/static/images/content/python-on-windows/recommended_install_1.png)](/static/images/content/python-on-windows/recommended_install_1.png)
-2. When it finishes downloading, click the file in your browser or find it in your Downloads folder and double-click it to start the installer.
+2. When it finishes downloading, click the file in your browser or find it in your Downloads folder and double-click it
+ to start the installer.
[![Step 2](/static/images/content/python-on-windows/recommended_install_2.png)](/static/images/content/python-on-windows/recommended_install_2.png)
3. Check the "Add python.exe to PATH" checkbox (the text may differ slightly depending on your installer). This will
- make it so the command line can recognize commands like `python` and `pip`. (Read [this
+ make it so terminals can recognize commands like `python` and `pip`. (Read [this
guide](../putting-python-on-path) to learn more.)
[![Step 3](/static/images/content/python-on-windows/recommended_install_3.png)](/static/images/content/python-on-windows/recommended_install_3.png)
@@ -57,8 +58,9 @@ Windows 11 or other modern versions of Python.)
[![Step 4](/static/images/content/python-on-windows/recommended_install_4.png)](/static/images/content/python-on-windows/recommended_install_4.png)
-5. It will take a minute to install and then (hopefully) say "Setup was successful". Congrats, you just installed
- Python! You can close the installer.
+5. It will take a minute to install and then (hopefully) say "Setup was successful".
+
+ Congrats! You just installed Python! You can close the installer.
[![Step 5 A](/static/images/content/python-on-windows/recommended_install_5.png)](/static/images/content/python-on-windows/recommended_install_5.png)
[![Step 5 B](/static/images/content/python-on-windows/recommended_install_6.png)](/static/images/content/python-on-windows/recommended_install_6.png)
@@ -72,9 +74,9 @@ Python console app and run some code like `print("Hello, World!")`.
Or try the more usual way of running Python by typing `python` in a new terminal window to open up the Python
[REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop), or use `python somefile.py` to run some
-Python file. Use whichever terminal you prefer: Command Prompt, PowerShell, an IDE-integrated terminal, [Windows
-Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701). It just has to be a freshly opened
-terminal or the commands may not be recognized.
+Python file. You can use whichever terminal you prefer: Command Prompt, PowerShell, an IDE-integrated terminal, [Windows
+Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701), etc. It just has to be a freshly
+opened terminal or the commands may not be recognized.
[![Testing py and python](/static/images/content/python-on-windows/recommended_install_8.png)](/static/images/content/python-on-windows/recommended_install_8.png)
@@ -96,23 +98,23 @@ is a great starting point.
At [python.org/downloads/windows](https://www.python.org/downloads/windows/) there are many different Windows Python
installer options available. A link to the latest release page is listed at the top, for example [the Python 3.11.0
-release page](https://www.python.org/downloads/release/python-3110/) has info about new features with downloads at the
-bottom. Back on the list of all Windows releases, pre-releases are on the right if you want to try cutting-edge (and
-possibly unstable) versions of Python, and stables releases are on the left, all the way back to Python 2.0.1 from 2001.
-Some minor versions may not have installers available.
+release page](https://www.python.org/downloads/release/python-3110/) has info about the new 3.11 features, with
+downloads at the bottom. Back on the list of all Windows releases, pre-releases are on the right if you want to try
+cutting-edge (and possibly unstable) versions of Python, and stables releases are on the left, all the way back to
+Python 2.0.1 from 2001. Some minor release versions may not have installers available.
-You should usually select the "Windows installer" option instead of the "Windows embeddable package". Check out [the
-official docs on Using Python on Windows](https://docs.python.org/3/using/windows.html) for more details on other ways
-to install Python on Windows.
+You should usually select the "Windows installer" option instead of the "Windows embeddable package" when picking what
+to get. Check out [the official documentation](https://docs.python.org/3/using/windows.html) for more
+details on installing and using Python on Windows.
### Which Version?
Current Python versions follow [the form `3.minor.micro`](https://peps.python.org/pep-0440/#final-releases) (similar to
[semantic versioning](https://semver.org/)), for example
[3.11.0](https://www.python.org/downloads/release/python-3110/). "3" is the major number and not about to change. Minor
-releases happen yearly and provide new features and breaking changes, whilst micro releases are more common and only
-include bug/security fixes. When people say "Python 3" they aren't necessarily specifying a minor or micro version, but
-you can assume they mean the latest ones.
+releases happen [yearly](https://endoflife.date/python) and provide new features and breaking changes, whilst micro
+releases are more common and only include bug/security fixes. When people say "Python 3" they they aren't necessarily
+specifying a minor or micro version, but you can often assume they mean the latest ones.
Installing the latest minor version will give you access to Python's newest features. However, some packages may not
support the newest versions straight away, so installing the second latest (for example, installing 3.10 when 3.11 is
@@ -120,12 +122,13 @@ the latest) will help you avoid those issues. If you find you want some newer fe
your current version, you can always install another version as well.
You should generally always install the newest micro version, although some may not provide an installer, in which case
-you should find the newest that does.
+you should find the newest one that does.
### What about Python 2 and 4?
-Python 2 should not be used unless you are absolutely required to use it for legacy code or school. [It was officially
-sunset January 1, 2020:](https://www.python.org/doc/sunset-python-2)
+Python 2 should not be used unless you are absolutely required to for legacy code or school.
+
+[It was officially sunset January 1, 2020:](https://www.python.org/doc/sunset-python-2)
> As of January 1st, 2020 no new bug reports, fixes, or changes will be made to Python 2, and Python 2 is no longer
> supported.
@@ -138,15 +141,15 @@ Python 4 is [not happening anytime soon](https://builtin.com/software-engineerin
### 32-bit vs 64-bit?
-Install 64-bit python unless you have reason not to, such as having an old 32-bit computer. Modern PCs ([and all Windows
+Install 64-bit Python unless you have reason not to, such as having an old 32-bit computer. Modern PCs ([and all Windows
11
PCs](https://answers.microsoft.com/en-us/windows/forum/all/does-microsoft-has-32-bit-version-of-windows-11/3bd76840-4e84-4573-8252-71380ef41bf1))
are 64-bit. With 32-bit you may run into memory limits if doing intensive operations (Python will be limited to using
-4GB of memory), and some installed modules may not offer prebuilt [wheels](https://realpython.com/python-wheels/) for 32
--it, potentially making installs slower or meaning you have to install build dependencies.
+4GB of memory), and some installed modules may not offer prebuilt [wheels](https://realpython.com/python-wheels/) for
+32-bit, potentially making installs slower or meaning you have to install build dependencies.
If you get an error when installing 64-bit Python, your computer may not support it. To find out if this is the case,
-search "About your PC" in the Start Menu and open the Settings page. Then look for the "System Type" option under
+search "About your PC" in the Start Menu and open the settings page. Then look for the "System Type" option under
"Device Specifications". It should say "64-bit operating system, x64-based processor" if you have support. You need a
64-bit processor and operating system to install 64-bit programs.
@@ -156,7 +159,7 @@ By default, when you install Python on Windows from a [python.org installer](htt
it comes with the "py launcher". The py launcher is a command line tool you invoke using the `py` command and it helps
you run a specific version of Python when you have multiple versions installed.
-The `py` command is not merely shorthand for the `python` command. They are separate programs as can be seen in the
+The `py` command is not mere shorthand for the `python` command. They are separate programs as can be seen in the
"Apps & features" Windows settings. Though running either of them with no arguments will start the Python
[REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop).
@@ -165,16 +168,16 @@ The py launcher provides the `py -0` command (or `py --list`) which lists the Py
For example, on my PC I have Python 3.11 and 3.10 installed, and the py launcher shows it:
-![py launcher list command](/static/images/content/python-on-windows/py_launcher_1.png)
+[![py launcher list command](/static/images/content/python-on-windows/py_launcher.png)](/static/images/content/python-on-windows/py_launcher.png)
-The versions are ordered from newest to oldest, and the asterisk (`*`) indicates which version running `py` will
-currently call by default (3.11 in my case). Exactly which version that is depends on the following requirements, and
-may not be the same version you get from running `python` (if you get any).
+The versions are ordered from newest to oldest, and the asterisk (`*`) indicates which version currently running `py`
+will call by default (3.11 in my case). Exactly which version that is depends on the following requirements, and may not
+be the same version you get when running `python` (if you get any).
-> If an exact version is not given to `py`, using the latest version can be overridden by the following, (in
-> priority order):
+> If an exact version is not given to `py`, the latest is used unless overridden by the following, (in priority
+> order):
>
-> - An active virtual environment/
+> - An active virtual environment.
> - A [shebang](<https://en.wikipedia.org/wiki/Shebang_(Unix)>) line in the script (if present).
> - With a `-2` or `-3` flag and matching PY_PYTHON2 or PY_PYTHON3 environment variable.
> - A PY_PYTHON environment variable.
@@ -193,7 +196,8 @@ on the Path so you can invoke it with `python`, and then using `py -X.Y` wheneve
`py -3.7`.
The official documentation of the `py launcher` can be found
-[here](https://docs.python.org/3/using/windows.html#python-launcher-for-windows).
+[here](https://docs.python.org/3/using/windows.html#python-launcher-for-windows). Use `py --help` to show help on the
+command line.
The py launcher is not available on GNU/Linux-based platforms such as macOS, but there is [an unofficial version by
Brett Cannon](https://github.com/brettcannon/python-launcher).
@@ -208,8 +212,9 @@ you install 3.2 or 4.1, one or the or the other of the projects will have the wr
environment for each project you can install the required Django version for each separately.
Virtual environments are not exclusive to Windows, but the commands to use them can differ a bit across operating
-systems. Check out the [official docs](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments) for
-more details but there are basically 3 important commands. Run them once `cd`ed into your project folder.
+systems. Check out the [official docs](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments) and
+the builtin [venv](https://docs.python.org/3/library/venv.html) module for more details, but there are basically 3
+important venv commands. Run them once you `cd` into your project folder.
1. Create a virtual environment: `python -m venv .venv`
2. Activate a virtual environment: `.venv\Scripts\activate`
@@ -222,10 +227,10 @@ should be able to tell when a venv is active because `(.venv)` or similar will a
prompts.
If your editor/IDE has handling for virtual environments, it's worth looking into how it works.
-Here's a [VSCode tutorial](https://code.visualstudio.com/docs/python/environments), and here's
-[one for Pycharm](https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html).
+[Here's a VSCode tutorial](https://code.visualstudio.com/docs/python/environments) and [here's
+one for Pycharm](https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html).
-The `venv` module used above is built into Python, but [Poetry](https://python-poetry.org/),
+The `venv` module used above comes with Python, but [Poetry](https://python-poetry.org/),
[Pipenv](https://pipenv.pypa.io/en/latest/), and [Virtualenv](https://virtualenv.pypa.io/en/latest/) are other popular
tools for managing dependencies and virtual environments. Answers to [this Stack Overflow
question](https://stackoverflow.com/questions/41573587) explain all the confusingly similar names and much more.
diff --git a/pydis_site/apps/content/resources/guides/python-guides/windows/microsoft-store.md b/pydis_site/apps/content/resources/guides/python-guides/windows/microsoft-store.md
index 89f11787..c7583714 100644
--- a/pydis_site/apps/content/resources/guides/python-guides/windows/microsoft-store.md
+++ b/pydis_site/apps/content/resources/guides/python-guides/windows/microsoft-store.md
@@ -4,15 +4,15 @@ description: The drawbacks of installing the Microsoft Store versions of Python
icon: fab fa-windows
---
-[<img style="margin:1rem;" align="right" width="480px"
+[<img style="margin:1rem;" align="right" width="500px"
src="/static/images/content/python-on-windows/ms_store_drake.png">](/static/images/content/python-on-windows/ms_store_drake.png)
Microsoft provides versions of Python for Windows [on the Microsoft
-Store](https://apps.microsoft.com/store/search/python) as an alternative to using the [full installer from
-python.org](https://www.python.org/downloads). **We recommend you install Python on Windows using the [full installer
+Store](https://apps.microsoft.com/store/search/python) as an alternative to using the installer from
+[python.org](https://www.python.org). **We recommend you install Python on Windows using the [full installer
from python.org](https://www.python.org/downloads), and not from the Microsoft store wherever possible!**
-You can follow [this guide to install Python from python.org](../installing-and-using-python) and more Python Windows
+You can follow [this guide](../installing-and-using-python) to install Python from python.org and more Python Windows
releases can be found [here](https://www.python.org/downloads/windows).
Here are some common issues with using Python from the Microsoft Store:
@@ -44,6 +44,8 @@ Here are some common issues with using Python from the Microsoft Store:
You can find the path of the executable for a version of Python by running `import sys; print(sys.executable)` in
it.
+ You can learn more about the Windows Path in [this guide](../putting-python-on-path).
+
- ##### Confusing app execution alias behaviour
Typing `python` into a terminal when it is not already installed or not properly on Path may open up the Microsoft
@@ -68,4 +70,4 @@ If you have the Microsoft Store version of Python and want to uninstall it, you
to open up the "Apps & features" settings and filter by "python". The Python app that has a console in the icon and
"Python Software Foundation" under the name is the Microsoft Store one. Click it and hit Uninstall.
-![Which version is which when uninstalling Python](/static/images/content/python-on-windows/ms_store_uninstall.png)
+[![Which version is which when uninstalling Python](/static/images/content/python-on-windows/ms_store_uninstall.png)](/static/images/content/python-on-windows/ms_store_uninstall.png)
diff --git a/pydis_site/apps/content/resources/guides/python-guides/windows/putting-python-on-path.md b/pydis_site/apps/content/resources/guides/python-guides/windows/putting-python-on-path.md
index 3c8face0..e991d485 100644
--- a/pydis_site/apps/content/resources/guides/python-guides/windows/putting-python-on-path.md
+++ b/pydis_site/apps/content/resources/guides/python-guides/windows/putting-python-on-path.md
@@ -12,7 +12,7 @@ recommended way](../installing-and-using-python)) but you're still getting error
pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program.
```
-when trying to run a [pip](https://pip.pypa.io/en/stable/) or [pyinstaller](https://pypi.org/project/pyinstaller/)
+when trying to run a [`pip`](https://pip.pypa.io/en/stable/) or [`pyinstaller`](https://pypi.org/project/pyinstaller/)
command, or running `python` [unexpectedly opens up the Microsoft
Store](../microsoft-store#confusing-app-execution-alias-behaviour), the issue is likely that your Windows Path
environment variable is improperly configured for Python. This just means Windows doesn't know how to find your Python
@@ -22,13 +22,13 @@ The Path (or PATH) environment variable is what Windows uses to locate executabl
you type a command name in your terminal, like `python` or `pip`, the terminal looks for a program of the same name in
the folders listed in the Path, so the command can be run.
-The [Python installer](https://www.python.org/downloads/) provides an option to add Python to your Path automatically,
-although it is not checked by default so many people miss it:
+The [python.org Python installer](https://www.python.org/downloads/) provides an option to add Python to your Path
+automatically, although it is not checked by default so many people miss it:
-![Add Python to path installer checkbox.](/static/images/content/python-on-windows/installer_path_checkbox.png)
+[![Add Python to path installer checkbox.](/static/images/content/python-on-windows/installer_path_checkbox.png)](/static/images/content/python-on-windows/installer_path_checkbox.png)
But don't worry, you can have the installer add it after the fact, or add it yourself! Continue on just below to the
-[safe method](#safe-method-let-the-installer-add-python-to-path) to have the installer put Python on Path for you, or,
+[safe method](#safe-method-let-the-installer-add-python-to-path) to have the installer put Python on Path for you. Or,
if you want to learn a handy Windows programming skill, skip to the [advanced
method](#advanced-method-manually-edit-the-path) that explains how to edit the Path manually.
@@ -36,37 +36,37 @@ method](#advanced-method-manually-edit-the-path) that explains how to edit the P
The easiest and safest way to add Python to Path is by rerunning the installer. For this you will need the same
installer you used to install Python, which you can download again if needed from
-[python.org](https://www.python.org/downloads/windows/), or it may still be in your Downloads folder (it's a file like
-`python-3.11.0-amd64.exe`).
+[python.org](https://www.python.org/downloads/windows/), or it may still be in your Downloads folder (it's a file named
+something like `python-3.11.0-amd64.exe`).
Once you have it, here are the steps to modify the installation to add Python to Path:
1. Run the installer by double clicking it.
- ![Step 1](/static/images/content/python-on-windows/safe_path_method_1.png)
+ [![Step 1](/static/images/content/python-on-windows/safe_path_method_1.png)](/static/images/content/python-on-windows/safe_path_method_1.png)
2. Select "Modify". (If you don't see the "Modify/Repair/Uninstall" screen then you likely have the wrong installer.)
- ![Step 2](/static/images/content/python-on-windows/safe_path_method_2.png)
+ [![Step 2](/static/images/content/python-on-windows/safe_path_method_2.png)](/static/images/content/python-on-windows/safe_path_method_2.png)
3. Hit "Next" to move past the "Optional Features" screen.
- ![Step 3](/static/images/content/python-on-windows/safe_path_method_3.png)
+ [![Step 3](/static/images/content/python-on-windows/safe_path_method_3.png)](/static/images/content/python-on-windows/safe_path_method_3.png)
-4. Check "Add Python to environment variables" on the "Advanced Options" screen.
+4. Check the "Add Python to environment variables" checkbox on the "Advanced Options" screen.
- ![Step 4](/static/images/content/python-on-windows/safe_path_method_4.png)
+ [![Step 4](/static/images/content/python-on-windows/safe_path_method_4.png)](/static/images/content/python-on-windows/safe_path_method_4.png)
5. Hit install!
- ![Step 5](/static/images/content/python-on-windows/safe_path_method_5.png)
+ [![Step 5](/static/images/content/python-on-windows/safe_path_method_5.png)](/static/images/content/python-on-windows/safe_path_method_5.png)
-Then, after a moment, it should say "Modify was successful" and you can close the installer, and Python should now be on
+Then, after a moment, it should say "Modify was successful" and you can close the installer. Python should now be on
your Path! **You will need to restart any terminals or editors you have open before they detect the change.**
-(These steps are for the Python 3.11 installer may differ slightly for other versions. Also, for step 1, if preferred,
-you can find your Python installation in the "Apps & features" Windows settings and hit "Modify" there, but you will
-still need to locate the installer exe at step 5 if it's not already in Downloads.)
+(These steps are for the Python 3.11 and installer may differ slightly for other versions. Also, for step 1, if
+preferred, you can find your Python installation in the "Apps & features" Windows settings and hit "Modify" there, but
+will still need to locate the installer exe at step 5 if it's not already in Downloads.)
### Verifying your changes
@@ -86,12 +86,12 @@ pip -V
and you should see the versions of Python and pip that you just added to Path:
-![Checking Python and pip versions.](/static/images/content/python-on-windows/testing_path_worked_1.png)
+[![Checking Python and pip versions.](/static/images/content/python-on-windows/testing_path_worked_1.png)](/static/images/content/python-on-windows/testing_path_worked_1.png)
Running `Get-Command python` in PowerShell, or `where python` in Command Prompt, you
can see where that terminal is finding the `python.exe` it would run when a `python` command is given:
-![Get-Command/where Python.](/static/images/content/python-on-windows/testing_path_worked_2.png)
+[![Get-Command/where Python.](/static/images/content/python-on-windows/testing_path_worked_2.png)](/static/images/content/python-on-windows/testing_path_worked_2.png)
(`where` in fact lists all the Pythons it finds, even the dummy [app execution
alias](../microsoft-store#confusing-app-execution-alias-behaviour) one that opens the Microsoft Store.)
@@ -105,12 +105,12 @@ import sys; print(sys.executable); exit();
to see that the exact executable that is currently running Python is what you expect:
-![Checking Python executable.](/static/images/content/python-on-windows/testing_path_worked_3.png)
+[![Checking Python executable.](/static/images/content/python-on-windows/testing_path_worked_3.png)](/static/images/content/python-on-windows/testing_path_worked_3.png)
Of course your username will probably not be "r", and your executable path may differ from
`C:\Users\<user>\AppData\Local\Programs\Python\Python311` depending on where you chose to install Python and what
-version you have. The last folder will be `Python310` for Python 3.10, `Python39` for Python 3.9, etc. But those
-differences don't matter if `python` and `pip` and other things like `pyinstaller` (if you've [pip
+version you have. The last folder will normally be `Python310` for Python 3.10, `Python39` for Python 3.9, etc. But
+those differences don't matter if `python` and `pip` and other things like `pyinstaller` (if you've [pip
installed](https://pypi.org/project/pyinstaller/) it) now work for you!
Hopefully things are indeed working, however, it is possible that, due to having multiple Python versions, or other
@@ -133,7 +133,7 @@ But, as explained [here](https://superuser.com/a/878382), when actually used, th
Path, forming one long list.
So, how it works is whenever you type a command like `python` into a terminal, the terminal looks for a matching
-runnable file like `python.exe` (or [`python.bat`](https://en.wikipedia.org/wiki/Batch_file)) in each of the folders
+runnable file like `python.exe` ([or `python.bat`](https://en.wikipedia.org/wiki/Batch_file)) in each of the folders
listed in the Path, starting with the System Path (top to bottom), and then the User Path (top to bottom). It stops
searching on the first one it finds and runs that program with the command line arguments you may have given it, hence
(hopefully) running Python from an installed `python.exe`.
@@ -153,90 +153,96 @@ Again, the Path lookup order is:
### Adding Python to your Path
-Here the common case of adding Python to the Windows Path is detailed. Though knowing how to manually modify the Path is
-handy beyond that whenever you need to change or debug which programs run on the command line. (The less customizable
-but [safer method is above](#safe-method-let-the-installer-add-python-to-path) if you missed it.)
+Here the common case of adding Python and the Python Scripts directory to the Windows Path is detailed. Though knowing
+how to manually modify the Path is handy beyond just Python for whenever you need to change or debug which programs run
+on the command line in Windows. (The less customizable but [safer method is
+above](#safe-method-let-the-installer-add-python-to-path) if you missed it.)
Follow these steps to add Python to the Path:
-1. First, find folder path your Python executable is in. There are a couple ways to do this:
+1. First, find the folder path your Python executable is in. There are a few ways to do this:
**Way 1**: Run `py -0p` on the command line and copy the folder path of the version you want:
- ![Finding exe with py.](/static/images/content/python-on-windows/finding_exe_1.png)
+ [![Finding exe with py.](/static/images/content/python-on-windows/finding_exe_1.png)](/static/images/content/python-on-windows/finding_exe_1.png)
**Way 2**: Run `import sys; print(sys.executable)` in Python on your PC and copy the folder path it prints out:
- ![Finding exe in repl.](/static/images/content/python-on-windows/finding_exe_2.png)
+ [![Finding exe in repl.](/static/images/content/python-on-windows/finding_exe_2.png)](/static/images/content/python-on-windows/finding_exe_2.png)
- Either way I end up with `C:\Users\r\AppData\Local\Programs\Python\Python311\` (no `python.exe` at the end).
+ **Way 3**: Root around a bit in your `C:\Users\<user>\AppData\Local\Programs\Python` folder or wherever you
+ installed Python to find the path to the folder that has the `python.exe` in it.
+
+ I end up with `C:\Users\r\AppData\Local\Programs\Python\Python311\` (no `python.exe` at the end).
Your path will of course be based on your username (my username is "r") and your version of Python, such as
`C:\Users\ducky\AppData\Local\Programs\Python\Python39\` if your username is "ducky" and you're using Python 3.9.
- Copy your path, we'll use it in steps 6 and 7.
+ Copy your path. We'll use it in steps 6 and 7.
-2. [This step is optional but helpful to see what's going on.] Copy the folder path from step 1 into the path bar of
- Windows File Explorer. In the folder you should be able to see `python.exe`, and in the Scripts subfolder, things
+2. [**This step is optional but helpful to see what's going on.**] Copy the folder path from step 1 into the path bar
+ of Windows File Explorer. In the folder you should be able to see `python.exe`, and in the Scripts subfolder, things
like `pip.exe` and `pyinstaller.exe` (if you have it installed).
- ![Finding exes in folder.](/static/images/content/python-on-windows/finding_exe_3.png)
+ [![Finding exes in folder.](/static/images/content/python-on-windows/finding_exe_3.png)](/static/images/content/python-on-windows/finding_exe_3.png)
These are the executables we want the command line to be able to find via the Windows Path.
3. Now, type "environment variables" in the Start menu or Start search box and open the "Edit the system environment
variables" option.
- ![Step 3](/static/images/content/python-on-windows/edit_path_1.png)
+ [![Step 3](/static/images/content/python-on-windows/edit_path_1.png)](/static/images/content/python-on-windows/edit_path_1.png)
4. Hit the "Environment Variables..." button.
- ![Step 4](/static/images/content/python-on-windows/edit_path_2.png)
+ [![Step 4](/static/images/content/python-on-windows/edit_path_2.png)](/static/images/content/python-on-windows/edit_path_2.png)
-5. In a new window you should see two "Path" variables, one under "User variables for &lt;user&gt;" and one under
+5. Then in a new window you should see two "Path" variables, one under "User variables for &lt;user&gt;" and one under
"System variables". Select one of them (most likely the User Path) and hit the "Edit..." button underneath it.
+ [![Step 5](/static/images/content/python-on-windows/edit_path_3.png)](/static/images/content/python-on-windows/edit_path_3.png)
+
I suggest using the User Path (what the screenshots show) for the default installation of Python. In general, only
put things on the System Path if they are installed for all users (e.g. in `C:\Program Files` or `C:\`) and you're
certain they won't overshadow anything in User Paths. **Remember, the System Path takes precedence over the User
Path when commands are looked up.**
- ![Step 5](/static/images/content/python-on-windows/edit_path_3.png)
-
(Don't worry if your variables or Path contents differ a bit from those shown.)
-6. The third window that opens is where the Path is actually edited. It shows the ordered list of the folders on the
+6. Now a third window opens and this is where the Path is actually edited. It shows the ordered list of the folders on the
Path and you can select the entries, edit them, reorder them, make new ones, delete them and so on. (Don't delete
any unless you know what you're doing!)
We want to add the Python executable path we found in step 1 as a new entry, so click "New" and paste in the path.
- ![Step 6](/static/images/content/python-on-windows/edit_path_4.png)
+ [![Step 6](/static/images/content/python-on-windows/edit_path_4.png)](/static/images/content/python-on-windows/edit_path_4.png)
7. We also need to add the Python Scripts directory to the Path to have commands like `pip` and `pyinstaller` work. So
hit "New" and paste in the Python executable path again, and type "Scripts" after it.
- ![Step 7](/static/images/content/python-on-windows/edit_path_5.png)
+ [![Step 7](/static/images/content/python-on-windows/edit_path_5.png)](/static/images/content/python-on-windows/edit_path_5.png)
+
+ (It doesn't matter whether or not they have trailing backslashes.)
8. Finally, select each of the paths you just added in turn and move them to the very top of the list using the "Move
Up" button. (Their relative order should not matter.)
- ![Step 8](/static/images/content/python-on-windows/edit_path_6.png)
+ [![Step 8](/static/images/content/python-on-windows/edit_path_6.png)](/static/images/content/python-on-windows/edit_path_6.png)
This step may not be strictly necessary, but remember that command lookup happens in order from top to bottom.
- Python is often bundled with other software that may end up on the Path, so there's there could be another
+ Python is often bundled with other software that may end up on the Path, so there could be another
`python.exe` in one of of the other folders on the path that gets in the way. (This exact thing has happened to me
when I put `C:\Program Files\Inkscape\bin` on my Path, as [Inkscape](https://inkscape.org/) comes with a copy of
Python.)
- Also, the System Path comes first in command lookup, so to be certain you to may want to go back and check the
- System Path (see step 5) and _carefully_ delete any entry that is a Python executable path blocking the one you just
- added. Though please, don't delete any Path entries you're aren't sure about! Just in case, for reference, [here are
- the important looking System Path entries](/static/images/content/python-on-windows/system_path_important.png) on my
- Windows 10 64-bit PC.
+ > _8.5._ Recall, the System Path comes before the User Path during command lookup, so to be certain you to may want
+ > to go back and check the "System variables" Path (see step 5) and _carefully_ delete any entry that you're sure is
+ > a path to a Python executable overshadowing the one you just added. Though please, don't delete any Path entries
+ > you're aren't certain about! Just in case, for reference, [here are the important looking System Path
+ > entries](/static/images/content/python-on-windows/system_path_important.png) on my 64-bit Windows 10 PC.
9. Finish by making sure to hit "OK" on each of the thee "Edit environment variable", "Environment Variable", and
- "System Properties" windows, and then you're done!
+ "System Properties" windows, and then you're done! (If you accidentally hit Cancel the changes may not be saved.)
- Python and Python Scripts should not be on your Path! **You will need to restart any terminals or editors you have
+ Python and Python Scripts should now be on your Path! **You will need to restart any terminals or editors you have
open before they detect the change.**
At this point you can [verify your changes in the same way as detailed above](#verifying-your-changes). Hopefully it
diff --git a/pydis_site/apps/content/resources/guides/python-guides/windows/unix-env-on-windows.md b/pydis_site/apps/content/resources/guides/python-guides/windows/unix-env-on-windows.md
index a17de183..22ca70d1 100644
--- a/pydis_site/apps/content/resources/guides/python-guides/windows/unix-env-on-windows.md
+++ b/pydis_site/apps/content/resources/guides/python-guides/windows/unix-env-on-windows.md
@@ -78,7 +78,7 @@ complete with command line utilities, that you can use alongside your normal Win
To set up WSL, check out [this installation guide from
Microsoft](https://learn.microsoft.com/en-us/windows/wsl/install). They also have an
-[FAQ](https://learn.microsoft.com/en-us/windows/wsl/faq) and a [best practices for using WSL in a development
+[FAQ](https://learn.microsoft.com/en-us/windows/wsl/faq) and a [best practices guide for using WSL in a development
environment](https://learn.microsoft.com/en-us/windows/wsl/setup/environment). The
[part](https://learn.microsoft.com/en-us/windows/wsl/setup/environment#set-up-windows-terminal) about getting [Windows
Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701) is particularly good advice as it lets
diff --git a/pydis_site/static/images/content/python-on-windows/py_launcher_1.png b/pydis_site/static/images/content/python-on-windows/py_launcher.png
index d4dfab84..d4dfab84 100644
--- a/pydis_site/static/images/content/python-on-windows/py_launcher_1.png
+++ b/pydis_site/static/images/content/python-on-windows/py_launcher.png
Binary files differ