aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site
diff options
context:
space:
mode:
authorGravatar discretegames <[email protected]>2022-11-07 15:19:00 -0800
committerGravatar discretegames <[email protected]>2022-11-07 15:19:00 -0800
commit4d734b047c8825fad94374aa8aa61a339951c60f (patch)
tree996337129554a7112f57e4ca9f3121c329b1f482 /pydis_site
parentProofread, tweaked, added links to common windows issues guide. (Also normali... (diff)
tweaks and link fixes to windows guides, still in reorg process
Diffstat (limited to 'pydis_site')
-rw-r--r--pydis_site/apps/content/resources/guides/python-guides/windows/installing-python.md15
-rw-r--r--pydis_site/apps/content/resources/guides/python-guides/windows/microsoft-store.md21
-rw-r--r--pydis_site/apps/content/resources/guides/python-guides/windows/putting-python-on-path.md39
-rw-r--r--pydis_site/apps/content/resources/guides/python-guides/windows/py-launcher.md8
-rw-r--r--pydis_site/apps/content/resources/guides/python-guides/windows/unix-env-on-windows.md6
-rw-r--r--pydis_site/static/images/content/python-on-windows/testing_path_worked_2.pngbin27470 -> 28472 bytes
-rw-r--r--pydis_site/static/images/content/python-on-windows/testing_path_worked_3.pngbin0 -> 28868 bytes
7 files changed, 48 insertions, 41 deletions
diff --git a/pydis_site/apps/content/resources/guides/python-guides/windows/installing-python.md b/pydis_site/apps/content/resources/guides/python-guides/windows/installing-python.md
index e9cf6343..e262d287 100644
--- a/pydis_site/apps/content/resources/guides/python-guides/windows/installing-python.md
+++ b/pydis_site/apps/content/resources/guides/python-guides/windows/installing-python.md
@@ -4,10 +4,13 @@ description: How we recommend installing Python on Windows
icon: fab fa-windows
---
-The recommended way to install Python on windows is directly from the
-[Python website's Downloads page](https://www.python.org/downloads/windows/).
-Installing Python from the Microsoft Store is not recommended as it can
-[cause issues](../microsoft-store.md).
+Our recommended way of installing Python on Windows is using a full installer from the official [python.org Downloads
+page](https://www.python.org/downloads/). Installing Python from the [Microsoft
+Store](https://apps.microsoft.com/store/search/python) is _not_ recommended as [it can cause various
+issues](../microsoft-store).
+
+On [python.org/downloads](https://python.org/downloads), click the big yellow "Download Python 3.x.x" button near the top of the page and it should automatically start a download of the installer for the latest stable version of Python
+that best suits your computer.
## Selecting an Installer
@@ -56,7 +59,7 @@ Python installation on your PATH and don't want this one to override it, don't
tick this.
If you installed Python without adding to PATH and now want to add it, see
-[our guide on adding Python to PATH](../python-on-windows.md#adding-python-to-your-path).
+[our guide on adding Python to PATH](../putting-python-on-path).
Then simply click install, and wait for the install to finish!
@@ -64,5 +67,5 @@ To test your installation, type "cmd" in the windows search bar and select
"Command Prompt" to open a terminal (make sure it's opened _after_ installation
has finished) type `python -V`, and press enter. If it outputs your python
version, you've successfully installed Python. (if you didn't add to PATH, you
-can use [the py launcher](../python-on-windows.md#the-py-launcher) to test
+can use [the py launcher](../py-launcher) to test
instead).
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 e4bac067..e77fe963 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
@@ -7,13 +7,12 @@ icon: fab fa-windows
[<img style="margin:1rem;" align="right" width="480px"
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 from python.org](https://www.python.org/downloads),
-and not from the Microsoft store wherever possible!**
+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
+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](../install-on-windows.md) and more Python Windows releases
+You can follow [this guide to install Python from python.org](../installing-python) 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:
@@ -27,9 +26,8 @@ Here are some common issues with using Python from the Microsoft Store:
- ##### It can cause issues with permissions
- Some modules and scripts wont work with it because of restricted permissions.
- This is explained
- [in the Python documentation](https://docs.python.org/3/using/windows.html#redirection-of-local-data-registry-and-temporary-paths)
+ Some modules and scripts wont work with it because of restricted permissions. This is explained [in the Python
+ documentation](https://docs.python.org/3/using/windows.html#redirection-of-local-data-registry-and-temporary-paths)
- ##### It can cause Path confusion
@@ -43,7 +41,8 @@ Here are some common issues with using Python from the Microsoft Store:
`C:\Users\<user>\AppData\Local\Programs\Python\Python311\Scripts` (for Python 3.11). If for some reason you want
both installed, put the ones you want the commands for higher up in Path.
- You can find the path of the executable for a version of Python by running `import sys; print(sys.executable)` in it.
+ You can find the path of the executable for a version of Python by running `import sys; print(sys.executable)` in
+ it.
- ##### Confusing app execution alias behaviour
@@ -67,6 +66,6 @@ Here are some common issues with using Python from the Microsoft Store:
If you have the Microsoft Store version of Python and want to uninstall it, you can search "uninstall" in the Start menu
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 (see image below). Click it and hit Uninstall.
+"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)
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 b78fc5d4..fc921623 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
@@ -5,10 +5,8 @@ icon: fab fa-windows
toc: 2
---
-<!-- TODO Test the guide if you have no admin privileges and mention the differences. -->
-
If you're on Windows and know you have [Python installed from python.org](https://www.python.org/downloads/) ([our
-recommended way](../installing-python.md)) but you're still getting errors like
+recommended way](../installing-python)) but you're still getting errors like
```text
pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program.
@@ -16,7 +14,7 @@ pip : The term 'pip' is not recognized as the name of a cmdlet, function, script
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.mdconfusing-app-execution-alias-behaviour), the issue is likely that your Windows Path
+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
installation.
@@ -72,7 +70,7 @@ still need to locate the installer exe at step 5 if it's not already in Download
### Verifying your changes
-To check that it worked, open a fresh terminal &mdash; Command Prompt, Powershell, an IDE-integrated terminal, [Windows
+To check that it worked, open a fresh terminal &mdash; Command Prompt, PowerShell, an IDE-integrated terminal, [Windows
Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701), whichever you prefer, just _not_ the
Python terminal with the `>>>` prompt &mdash; and run
@@ -90,19 +88,24 @@ 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)
-You can also run Python with `python`, and then after `>>>` in the Python REPL, run
+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)
+
+(`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.)
+
+You can also run Python with `python` (not `py` as that may start a different version, see more
+[here](.../py-launcher)), and then after `>>>` in the Python REPL, run
```py
-import sys; print(sys.executable)
+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_2.png)
-
-Type `exit()` from here to go back to the normal terminal.
-
-<!-- TODO mention that py may open a different version and link to py launcher guide. -->
+![Checking Python executable.](/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
@@ -142,7 +145,7 @@ foobar: The term 'foobar' is not recognized as the name of a cmdlet, function, s
```
Or, in the case of not finding `python`, it may [open up the Microsoft
-store](../microsoft-store.md#confusing-app-execution-alias-behaviour).
+store](../microsoft-store#confusing-app-execution-alias-behaviour).
Again, the Path lookup order is:
@@ -220,8 +223,9 @@ Follow these steps to add Python to the Path:
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.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.)
+ `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
@@ -232,10 +236,13 @@ Follow these steps to add Python to the Path:
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!
- Python and Python Scripts should not be on your Path! **You will need to restart any terminals or editors you have open before they detect the change.**
+ Python and Python Scripts should not 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
works!
(These steps were written with Windows 10 and Python 3.11 in mind, but they should be identical or similar for Windows
11 and other recent versions of Python.)
+
+<!-- dg:TODO? Test the guide if you have no admin privileges and mention the differences. -->
diff --git a/pydis_site/apps/content/resources/guides/python-guides/windows/py-launcher.md b/pydis_site/apps/content/resources/guides/python-guides/windows/py-launcher.md
index 388177ec..99d6deda 100644
--- a/pydis_site/apps/content/resources/guides/python-guides/windows/py-launcher.md
+++ b/pydis_site/apps/content/resources/guides/python-guides/windows/py-launcher.md
@@ -1,12 +1,10 @@
---
-title: The py Launcher on Windows
-description: Common commands and usage of the Windows "py" Python launcher
+title: The py Launcher
+description: Common commands and usage of the "py" Python launcher on Windows
icon: fab fa-windows
---
-When you install Python on Windows fron
-
-TODO!!! rewrite/rearrange to be all about the py command
+<!-- dg:TODO rewrite/rearrange to be all about the py command -->
## The py launcher
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 f52ddfed..d959d1f6 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
@@ -4,8 +4,6 @@ description: How to setup a Unix-style Python environment ready to start coding
icon: fab fa-windows
---
-<!-- TODO? Mention WSL2? -->
-
Many programmers use Linux or macOS operating systems for their work, though newcomers to programming will likely want
to get started on the computer they already own, which will often be running Windows.
@@ -17,7 +15,7 @@ command prompt called Git Bash, which will support many of the commands availabl
## Installing Python
First you'll need to install Python. We recommend installing from the Python website, you can follow our guide on how to
-do this [here](../install-on-windows.md).
+do this [here](../installing-python).
## Installing a text editor
@@ -70,3 +68,5 @@ location, you can use the `cd` command ("cd" stands for "change directory") to n
desktop, `cd /c/Users/YourUsername/Desktop` will take you there. Otherwise if you have the directory open in your file
explorer, you can right click anywhere in the white space of the file explorer window (not on top of a file) and select
"Git Bash Here". Once you're there, type `python hello.py`, and the program will run.
+
+<!-- dg:TODO? Mention WSL2? -->
diff --git a/pydis_site/static/images/content/python-on-windows/testing_path_worked_2.png b/pydis_site/static/images/content/python-on-windows/testing_path_worked_2.png
index 7c71a331..465a873c 100644
--- a/pydis_site/static/images/content/python-on-windows/testing_path_worked_2.png
+++ b/pydis_site/static/images/content/python-on-windows/testing_path_worked_2.png
Binary files differ
diff --git a/pydis_site/static/images/content/python-on-windows/testing_path_worked_3.png b/pydis_site/static/images/content/python-on-windows/testing_path_worked_3.png
new file mode 100644
index 00000000..25493102
--- /dev/null
+++ b/pydis_site/static/images/content/python-on-windows/testing_path_worked_3.png
Binary files differ