Installation and setup¶
This page explains how to set up a working Python environment for the Sustainable Aircraft Propulsion exercises.
Instructions are provided for:
- Windows
- macOS
No prior Python experience is assumed.
1. Install Python and basic tools¶
1.1 Install Miniconda (recommended)¶
We use Conda to manage dependencies in a reproducible way.
Windows¶
- Go to: https://docs.conda.io/en/latest/miniconda.html
- Download Miniconda (Python 3.x, 64-bit, Windows)
- Run the installer:
- choose “Just Me”
- allow the installer to initialize Conda
- allow Conda to modify your PATH (recommended)
After installation, open Anaconda Prompt (from the Start Menu).
macOS¶
- Go to: https://docs.conda.io/en/latest/miniconda.html
- Download Miniconda (Python 3.x, macOS) for your architecture:
- Apple Silicon (arm64), or
- Intel (x86_64)
- Run the installer (
.pkg) and follow the default options.
After installation, open Terminal.
1.2 Verify Conda installation¶
In a terminal (macOS) or Anaconda Prompt (Windows):
conda --version
You should see a Conda version printed.
2. Install a code editor (Visual Studio Code)¶
We strongly recommend Visual Studio Code (VS Code).
- Download from: https://code.visualstudio.com/
- Install using default options.
Recommended VS Code extensions¶
After opening VS Code, install:
- Python (by Microsoft)
- Jupyter (by Microsoft)
These enable:
- Python script execution
- Jupyter notebook support
- integrated debugging
3. Get the course repository¶
Clone the repository (recommended):
git clone https://github.com/rmalpica/SAP-exercises.git
cd SAP-exercises
If you do not have Git installed:
- Windows: https://git-scm.com/download/win
- macOS: Git is usually available by default, or via Xcode Command Line Tools
4. Create the Conda environment¶
From the repository root directory:
conda env create -f environment.yml
conda activate saprop
This installs all required dependencies (NumPy, SciPy, Cantera, PyTorch, etc.).
5. Register the Jupyter kernel (one time only)¶
This makes the environment available inside Jupyter:
python -m ipykernel install --user --name saprop --display-name "SAProp (saprop)"
6. Install external course packages¶
6.1 Install PhlyGreen¶
PhlyGreen is used in the Hybrid-Electric Propulsion chapter.
pip install "git+https://github.com/rmalpica/PhlyGreen.git@a5ff60ca9feaf94e518ef7eaab2e59af7718106c#subdirectory=trunk"
6.2 Install pyAircraftEngineFramework¶
This package is used in selected engine-modeling exercises.
pip install "git+https://github.com/rmalpica/pyAircraftEngineFramework"
7. Running the exercises¶
7.1 Python scripts¶
If you run from Command Line (terminal or Anaconda prompt), activate the environment first:
conda activate saprop
then navigate to the folder and run, in example:
cd chapters/300_mechanisms/scripts/
python EI.py
Alterntively, run the script from Visual Studio Code.
7.2 Jupyter notebooks¶
From the repository root:
conda activate saprop
jupyter lab
Then:
- Open the notebook you want to run
- Select kernel “SAProp (saprop)”
8. Common issues¶
See Troubleshooting.
9. Final check¶
If everything is correctly installed:
- Python scripts should run without import errors
- Jupyter notebooks should execute using the saprop kernel
You are now ready to work on the course exercises.