Python for Windows on Arm: Install Guide (2024)

About this Install Guide

Reading time: 15 min
Last updated:10 Oct 2023
Reading time:
15 min
Last updated:
10 Oct 2023
Author:Arm
Official docs:View
Author:
Arm
Official docs:
View

This guide is intended to get you up and running with this tool quickly with the most common settings. For a thorough review of all options, refer to the official documentation.

Python has native support forWindows on Arm. Starting with version 3.11, an official installer is available. The latest version at time of writing is 3.12.0.

A number of developer ready Windows on Armdevices are available.

Windows on Arm instances are available with Microsoft Azure. For more information, seeDeploy a Windows on Arm virtual machine on Microsoft Azure.

Download and install

The installer can be downloaded from thePython website. Locate the ARM64 installer.

You can also download from a PowerShell terminal.

  curl https://www.python.org/ftp/python/3.12.0/python-3.12.0-arm64.exe -O python-3.12.0-arm64.exe 

Once downloaded, run the installer exe file on a Windows on Arm machine.

The installer will start.

Check Add python.exe to PATH if you want to easily invoke python from any directory.

Python for Windows on Arm: Install Guide (1)

Setup was successful is displayed when complete.

Python for Windows on Arm: Install Guide (2)

Invoke python

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

  py 
  Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:15:47) [MSC v.1935 64 bit (ARM64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> 

Enter exit() to leave interpreter.

  exit() 

Test an example

To confirm python is working, save the code below into a file uname.py.

uname.py

  import platformprint("Python version", platform.python_version())print("Machine is", platform.uname().system, platform.uname().release, platform.uname().machine) 

Run the code.

  py uname.py 

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

  Python version 3.12.0Machine is Windows 11 ARM64 

Installing packages

Python pip can be used to install packages.

For example, to installFlask:

  pip install Flask 

Save the code below as hello.py:

hello.py

  import platformfrom flask import Flaskapp = Flask(__name__)@app.route("/")def hello(): return "<h1><b>Hello from %s %s %s %s</b></h1>" % (platform.system(), platform.release(), platform.version(), platform.machine())if __name__ == "__main__": app.run(host="0.0.0.0") 

Run the application:

  python hello.py 

The output will be similar to:

  * Serving Flask app 'hello' * Debug mode: offWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on all addresses (0.0.0.0) * Running on http://127.0.0.1:5000 * Running on http://10.8.0.10:5000Press CTRL+C to quit 

Open a browser to the URL printed by the application. In this example:

  http://127.0.0.1:5000 

The output is displayed in the browser window.

Python for Windows on Arm: Install Guide (3)

The accesses are reported in the command prompt:

  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

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

Python for Windows on Arm: Install Guide (4)

You can create and run Python applications in this environment.

For example, use File > Open... (Ctrl+O) to open the above uname.py.

Then select Run > Run module (F5) to execute.

Python for Windows on Arm: Install Guide (5)

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

Python for Windows on Arm: Install Guide (2024)
Top Articles
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 5652

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.