-
Notifications
You must be signed in to change notification settings - Fork 0
Python Development Environment
This page describes how to set up the Python development environment for building Magic Lantern Python Studio.
These instructions may be used to set up the Python development environment for the Linux Platform. They have been tested using the Ubuntu 18.04 LTS 64-bit operating system.
Update and upgrade your system to ensure that your shipped version of Python 3 is up-to-date.
sudo apt update
sudo apt -y upgrade
Check which version of Python 3 is installed by typing:
python3 -V
To manage software packages for Python, install pip, a tool that will install and manage libraries or modules to use in your projects.
sudo apt install -y python3-pip
Python packages can be installed by typing:
pip3 install package_name
There are a few more packages and development tools to install to ensure that we have a robust set-up for our programming environment:
sudo apt install build-essential libssl-dev libffi-dev python3-dev
See Create a Virtual Environment to setup a Python virtual environment. For example:
python3 -m venv mle-python-env
To activate and use the Python3 toolchain, do the following:
source ./mle-python-env/bin/activate
To use Qt for Python, you will need to install PySide2 (for Qt5 support). Do the following after activating the virtual environment:
pip install pyside2
If your build is having troubles finding Python.h, make sure that you have installed the autoconf-archive package (see https://www.gnu.org/software/autoconf-archive). This package installs additional AX_ macros utilized by the Python configure.ac configuration in Magic Lantern Studio.
Python v3.12 and later no longer installs distutils. Use pip to install the package setuptools to workaround this issue:
pip install setuptools
These instructions may be used to set up the Python development environment for the Macintosh OS Platform. They have been tested using the macOS Catalina (10.15.4) operating system.
Use Installing Python 3 on Mac OS X instructions for installing Python 3.
Python v3.12 and later no longer installs distutils. Use pip to install the package setuptools to workaround this issue:
brew install python-setuptools
These instructions may be used to set up the Python development environment for the Windows Platform.
Version 3.10.11 of Python can be downloaded from here. Use this installer executable to install python.
Add the PYTHON_HOME environment variable using the location where you installed the program (e.g. C:\Users\msm\AppData\Local\Programs\Python\Python310).
The debug library is not installed by default with the standard Python installer. It requires manual selection during the installation process.
Copyright (c) 2021-2025 Wizzer Works All rights reserved.