Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed content/install-guides/_images/idle.png
Binary file not shown.
Binary file modified content/install-guides/_images/py1-woa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/install-guides/_images/py2-woa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/install-guides/_images/py3-woa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 27 additions & 21 deletions content/install-guides/py-woa.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ multitool_install_part: false # Set to true if a sub-page of a multi-page arti
layout: installtoolsall # DO NOT MODIFY. Always true for tool install articles
---

Python has native support for [Windows on Arm](https://learn.microsoft.com/en-us/windows/arm/overview). Starting with version 3.11, an official installer is available. The latest version at time of writing is 3.12.0.
Python has native support for [Windows on Arm](https://learn.microsoft.com/en-us/windows/arm/overview). Starting with version 3.11, an official installer is available. The latest version at time of writing is 3.13.0.

A number of developer ready Windows on Arm [devices](/learning-paths/laptops-and-desktops/intro/find-hardware/) are available.

Windows on Arm instances are available with Microsoft Azure. For more information, see [Deploy a Windows on Arm virtual machine on Microsoft Azure](/learning-paths/cross-platform/woa_azure/).

## Download and install
## How do I download and install Python for Windows on Arm?

The installer can be downloaded from the [Python website](https://www.python.org/downloads/windows/). Locate the `ARM64` installer.

You can also download from a PowerShell terminal.
```command
curl https://www.python.org/ftp/python/3.12.0/python-3.12.0-arm64.exe -O python-3.12.0-arm64.exe
curl https://www.python.org/ftp/python/3.13.0/python-3.13.0-arm64.exe --output python-3.13.0-arm64.exe
```

Once downloaded, run the installer `exe` file on a Windows on Arm machine.
Expand All @@ -54,44 +54,52 @@ Check `Add python.exe to PATH` if you want to easily invoke python from any dire

![Complete #center](/install-guides/_images/py2-woa.png)

## Invoke python
## How do I start Python on Windows?

At a Windows Command prompt or a PowerShell prompt use `python` or `py` to start the interpreter.

```cmd
py
```

The interpreter starts with output similar to:

```output
Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:15:47) [MSC v.1935 64 bit (ARM64)] on win32
Python 3.13.0 (tags/v3.13.0:60403a5, Oct 7 2024, 10:17:29) [MSC v.1941 64 bit (ARM64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
```
Enter `exit()` to leave interpreter.

Enter `exit()` to leave the interpreter:

```python
exit()
```

## Test an example
## How can I run a Python example?

To confirm python is working, save the code below into a file `uname.py`.
To confirm python is working, use a text editor to save the code below to a file named `uname.py`.

#### uname.py
```python
import platform
print("Python version", platform.python_version())
print("Machine is", platform.uname().system, platform.uname().release, platform.uname().machine)
```

Run the code.
Run the code:

```console
py uname.py
```

Running on a Windows on Arm machine produces the output similar to:

```output
Python version 3.12.0
Python version 3.13.0
Machine is Windows 11 ARM64
```

## Installing packages
## How do I install Python packages?

Python `pip` can be used to install packages.

Expand All @@ -100,9 +108,8 @@ For example, to install [Flask](https://palletsprojects.com/p/flask/):
pip install Flask
```

Save the code below as `hello.py`:
Use a text editor to save the code below as `hello.py`:

#### hello.py
```python
import platform
from flask import Flask
Expand Down Expand Up @@ -131,28 +138,28 @@ WARNING: This is a development server. Do not use it in a production deployment.
* Running on http://10.8.0.10:5000
Press CTRL+C to quit
```
Open a browser to the URL printed by the application. In this example:
Open a browser with the URL printed by the application. In this example:
```url
http://127.0.0.1:5000
```
The output is displayed in the browser window.

![Complete #center](/install-guides/_images/flask-woa.png)

The accesses are reported in the command prompt:
The accesses are reported in the command window:

```output
127.0.0.1 - - [<timestamp>] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [<timestamp>] "GET /favicon.ico HTTP/1.1" 404 -
10.8.0.10 - - [<timestamp>] "GET / HTTP/1.1" 200 -
10.8.0.10 - - [<timestamp>] "GET /favicon.ico HTTP/1.1" 404 -
```
Use `Ctrl+C` to kill the application.

## Using IDLE
Use `Ctrl+C` to stop the application.

Python `IDLE` is included in the installation. IDLE is a simple IDE for python development. You can locate it in your start menu.
## Is Python IDLE available?

![IDLE #center](/install-guides/_images/idle.png)
Python `IDLE` is included in the installation. IDLE is a simple IDE for python development. You can locate it in your start menu.

You can create and run Python applications in this environment.

Expand All @@ -163,5 +170,4 @@ Then select `Run` > `Run module` (`F5`) to execute.
![IDLE uname #center](/install-guides/_images/py3-woa.png)



You are now ready to use Python on your Windows on Arm device.