Skip to content

Installation

This guide will help you install pyetm and set up your development environment.

Prerequisites

Before installing pyetm, ensure you have Python 3.12 or later installed on your system.

Check Your Python Version

python3 --version

You should see output like Python 3.12.0 or higher.

Installing Python

If you need to install or upgrade Python:

Using Homebrew:

brew install python@3.12

Download the installer from python.org and run it.

Add to PATH

Make sure to check "Add Python to PATH" during installation.

Using apt (Debian/Ubuntu):

sudo apt update
sudo apt install python3.12 python3.12-venv python3-pip

Using dnf (Fedora/RHEL):

sudo dnf install python3.12

Installation Methods

Install pyetm directly from PyPI:

pip install pyetm

To install a specific version:

pip install pyetm==2.0.0b9

If you're contributing to pyetm or want to work with the source code:

  1. Install Poetry (if not already installed):

    curl -sSL https://install.python-poetry.org | python3 -
    

  2. Clone the repository:

    git clone https://github.com/quintel/pyetm.git
    cd pyetm
    

  3. Install dependencies:

    poetry install
    

  4. Activate the virtual environment:

    poetry shell
    

Method 3: From Source

To install directly from the GitHub repository:

pip install git+https://github.com/quintel/pyetm.git

Virtual Environments

Best Practice

Always use a virtual environment to isolate your project dependencies.

Using venv

Create a virtual environment:

python3 -m venv .venv

Activate it:

source .venv/bin/activate
.venv\Scripts\Activate.ps1
.venv\Scripts\activate.bat

Install pyetm:

pip install pyetm

Using Poetry

Poetry automatically manages virtual environments for you:

poetry add pyetm

Verifying Installation

After installation, verify that pyetm is working correctly:

import pyetm

print(pyetm.__version__)

Or from the command line:

python3 -c "import pyetm; print(pyetm.__version__)"

You should see the version number printed (e.g., 2.0.0b9).

Optional Dependencies

pyetm has minimal required dependencies, but you may want to install additional packages for specific use cases:

For Jupyter Notebooks

pip install jupyter notebook

For Data Analysis

pip install pandas matplotlib seaborn

These are already included in the base installation of pyetm.

Next Steps

Now that you have pyetm installed, proceed to the Quick Start Guide to create your first scenario!

Troubleshooting

SSL Certificate Errors

If you encounter SSL certificate errors when connecting to the ETM API, see the Configuration Guide for solutions.

Import Errors

If you see ModuleNotFoundError: No module named 'pyetm':

  1. Ensure your virtual environment is activated
  2. Verify the installation with pip list | grep pyetm
  3. Try reinstalling: pip install --force-reinstall pyetm

Permission Errors

If you see permission errors during installation:

  • Use a virtual environment (recommended)
  • Or install with the --user flag: pip install --user pyetm
  • Never use sudo pip install as it can cause system-wide conflicts