Installation Error for SMUTHI on Google Colab

9 views
Skip to first unread message

Mohibur Rahman

unread,
Jul 30, 2025, 9:19:38 AMJul 30
to Smuthi
Whenever I try to run the command !pip install smuthi in Google Colab, I get the following error:  




Collecting smuthi
  Using cached SMUTHI-2.1.2.tar.gz (514 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.19.3 in /usr/local/lib/python3.11/dist-packages (from smuthi) (2.3.2)
Collecting argparse (from smuthi)
  Using cached argparse-1.4.0-py2.py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: imageio in /usr/local/lib/python3.11/dist-packages (from smuthi) (2.37.0)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.11/dist-packages (from smuthi) (3.10.0)
Requirement already satisfied: mpmath in /usr/local/lib/python3.11/dist-packages (from smuthi) (1.3.0)
Requirement already satisfied: numba in /usr/local/lib/python3.11/dist-packages (from smuthi) (0.60.0)
Requirement already satisfied: pyyaml in /usr/local/lib/python3.11/dist-packages (from smuthi) (6.0.2)
Requirement already satisfied: scipy in /usr/local/lib/python3.11/dist-packages (from smuthi) (1.16.0)
Requirement already satisfied: sympy in /usr/local/lib/python3.11/dist-packages (from smuthi) (1.13.1)
Requirement already satisfied: tqdm in /usr/local/lib/python3.11/dist-packages (from smuthi) (4.67.1)
Requirement already satisfied: h5py in /usr/local/lib/python3.11/dist-packages (from smuthi) (3.14.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.11/dist-packages (from smuthi) (2.22)
Requirement already satisfied: psutil in /usr/local/lib/python3.11/dist-packages (from smuthi) (5.9.5)
Requirement already satisfied: pywigxjpf in /usr/local/lib/python3.11/dist-packages (from smuthi) (1.13.3)
Requirement already satisfied: pillow>=8.3.2 in /usr/local/lib/python3.11/dist-packages (from imageio->smuthi) (11.3.0)
Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.11/dist-packages (from matplotlib->smuthi) (1.3.2)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.11/dist-packages (from matplotlib->smuthi) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.11/dist-packages (from matplotlib->smuthi) (4.59.0)
Requirement already satisfied: kiwisolver>=1.3.1 in /usr/local/lib/python3.11/dist-packages (from matplotlib->smuthi) (1.4.8)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.11/dist-packages (from matplotlib->smuthi) (25.0)
Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.11/dist-packages (from matplotlib->smuthi) (3.2.3)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.11/dist-packages (from matplotlib->smuthi) (2.9.0.post0)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/dist-packages (from python-dateutil>=2.7->matplotlib->smuthi) (1.17.0)
Requirement already satisfied: llvmlite<0.44,>=0.43.0dev0 in /usr/local/lib/python3.11/dist-packages (from numba->smuthi) (0.43.0)
Collecting numpy>=1.19.3 (from smuthi)
  Using cached numpy-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
Requirement already satisfied: cffi>=1.0.0 in /usr/local/lib/python3.11/dist-packages (from pywigxjpf->smuthi) (1.17.1)
Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Using cached numpy-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.5 MB)
Building wheels for collected packages: smuthi
  error: subprocess-exited-with-error
 
  × Building wheel for smuthi (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
 
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for smuthi (pyproject.toml) ... error
  ERROR: Failed building wheel for smuthi
Failed to build smuthi
ERROR: Failed to build installable wheels for some pyproject.toml based projects (smuthi)

Amos Egel

unread,
Jul 31, 2025, 2:20:03 AMJul 31
to smu...@googlegroups.com

Yes, it seems that Smuthi cannot be used with Python 3.11. Please try Python 3.10 or older.

ERROR: Failed to build installable wheels for some pyproject.toml based projects (smuthi) --
Smuthi project repository: https://gitlab.com/AmosEgel/smuthi
Online documentation https://smuthi.readthedocs.io/en/latest/
---
You received this message because you are subscribed to the Google Groups "Smuthi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smuthi+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smuthi/4da39813-fd2f-46ac-bbaa-da07d810e3a3n%40googlegroups.com.

Hadi K. Shamkhi

unread,
Jul 31, 2025, 3:56:50 AMJul 31
to Amos Egel, smu...@googlegroups.com

Of course. Here is a comprehensive guide to installing smuthi, compiling all the problems we solved into a single, step-by-step process.


This what got through, hope it is helpful 😅


## Step 1: Install System Prerequisites 🛠️

Before starting, your system needs essential development tools. This guide uses commands for Debian/Ubuntu-based systems.

  1. Install Git:

    Bash
    sudo apt install git
    
  2. Install Build Tools: You need a C and Fortran compiler, plus the development libraries required to build Python from source.

    Bash
    sudo apt update
    sudo apt install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
    libreadline-dev libsqlite3-dev curl libncursesw5-dev xz-utils \
    tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
    

## Step 2: Set Up an Older Python Version 🐍

Do not use your system's default Python. Install a specific, older version using pyenv to avoid conflicts.

  1. Install pyenv:

    Bash
    curl https://pyenv.run | bash
    
  2. Configure Your Shell: Add the following lines to the end of your ~/.bashrc or ~/.zshrc file, then restart your terminal.

    Bash
    export PYENV_ROOT="$HOME/.pyenv"
    command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
    eval "$(pyenv init -)"
    
  3. Install Python 3.9:

    Bash
    pyenv install 3.9.19
    

## Step 3: Create the Isolated Build Environment 🧪

This is the most critical phase. We will create a virtual environment and install the specific, older build tools that smuthi requires.

  1. Create a Project Directory:

    Bash
    mkdir smuthi_install
    cd smuthi_install
    
  2. Set the Local Python Version:

    Bash
    pyenv local 3.9.19
    
  3. Create and Activate a Virtual Environment:

    Bash
    python -m venv venv
    source venv/bin/activate
    

    Your terminal prompt should now start with (venv).

  4. Install Pinned Build Tools: Install old, compatible versions of setuptools, numpy, and wheel. This is essential to prevent compiler and build system errors.

    Bash
    pip install "setuptools<60.0" "numpy<1.20" wheel
    

## Step 4: Install SMUTHI from GitLab

Now, install smuthi itself, using flags to prevent its automatic dependency resolution from breaking our carefully prepared environment.

  • Note on GitLab Access: While SSH access is possible, using the simple HTTPS URL (https://...) is recommended as it avoids the public key permissions errors we encountered. The correct repository is AmosEgel/smuthi.

  • Run the Installation Command:

    This command uses --no-build-isolation to force pip to use our installed tools and --no-deps to prevent it from installing conflicting dependencies.

    Bash
    pip install --no-build-isolation --no-deps git+https://gitlab.com/AmosEgel/smuthi.git
    

## Step 5: Install Runtime Dependencies

Because we used --no-deps, you must now manually install all the other packages smuthi needs to run. Installing them all at once with versions pinned for compatibility is the most reliable method.

  • Install All Dependencies:

    Bash
    pip install tqdm argparse mpmath psutil pycparser pywigxjpf pyyaml sympy "matplotlib<3.6" "h5py<3.2" "imageio<2.23" "numba<0.56" "scipy<1.6"
    

At this point, smuthi is fully installed and functional within this terminal environment. You can test it with python -c "import smuthi".


## Step 6: Connect to Jupyter / VS Code (Optional)

To use this working environment in a notebook, you must register it as a Jupyter kernel.

  1. Activate Your Environment (if not already active):

    Bash
    source venv/bin/activate
    
  2. Install ipykernel:

    Bash
    pip install ipykernel
    
  3. Link the Environment to Jupyter:

    Bash
    python -m ipykernel install --user --name=smuthi_env --display-name="Python (smuthi)"
    
  4. Usage: Restart VS Code or your Jupyter server. You can now select "Python (smuthi)" as your kernel, giving you access to your working installation.




--

Hadi K. Shamkhi, PhD

Physics and Mathematics

Republic of Singapore


Reply all
Reply to author
Forward
0 new messages