INSTALLING PYTHON

Installing Python

Date Published:
Last Modified:

Overview

Python can be installed onto operating systems in a variety of different ways.

Windows

The easiest way is to visit https://www.python.org/downloads/ and download the web-based installer which will downloaded the needed components at install time.

You may have to add the python.exe install location to your system PATH manually. Python will typically be installed to:

C:\Users\<username>\AppData\Local\Programs\Python\Python<version>\

when installed for a single user on Windows 10. You will also want to add the Scripts\ folder so that you can call pip from the command-line, so also add the following to your PATH:

C:\Users\<username>\AppData\Local\Programs\Python\Python<version>\Scripts\

The Anaconda distribution is also contains the Python interpreter.

Windows 10 introduced what I consider a really annoying “feature” called App Execution Aliases. What this means is that if you don’t have python installed on your system but try and execute python.exe, Windows will jump in a load up the Windows Store to prompt you to download and install it. While good natured in principle, it causes many headaches as 3rd party software which tried to invoke python will not get the error message it expects.

You can disable App Execution Aliases for python.exe and python3.exe by searching for Managing App Execution Aliases in the Windows Search. Load up the settings window and deselect all versions of python.

Deselect all flavours of python.exe from the App Execution Aliases settings dialogue in Windows to prevent the Windows Store from opening when you try and invoke a non-existent python.exe.

Deselect all flavours of python.exe from the App Execution Aliases settings dialogue in Windows to prevent the Windows Store from opening when you try and invoke a non-existent python.exe.

You might get an error like shown below if you try and invoke a non-existent python.exe when arguments are provided (Windows Store will NOT load in this case):

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

CentOS

ModuleNotFoundError: No module named ‘_ctypes’

This is likely due to libffi-dev (Debian-like) or libffi-devel (RedHat-like) missing from your systems. Install with (on RedHat-like systems):

$ sudo yum install libffi-devel

and then try building Python again.


Related Content:

Tags:

comments powered by Disqus