Saturday, May 30, 2020

Installing Pyomo on colab by google

Google has a nice online environment ( to run Python code. So let's try Pyomo...

The installation instructions are simple:

 The first step was easy:

However, the second step was unsuccessful:

This is of course a little bit disappointing. I am not aware of a workaround.


  1. Hi Erwin,

    There's an open issue in the Pyomo repo about this (trying to pip install pyomo-extras) - A workaround can be to conda install the package instead.

    As Google Colab doesn't include Conda, we have to install it first. I found this link and used the same idea:

    1) First, install a Miniconda distribution.
    !wget -c
    !chmod +x
    !bash ./ -b -f -p /usr/local

    2) then add to the environment:
    import sys

    3) conda install pyomo and pyomo.extras.
    !conda install -c conda-forge pyomo
    !conda install -c conda-forge pyomo.extras

    This code worked with no errors in a Google Colab environment, those command could be at the notebook's first cell in order to install pyomo & pyomo-extras. I hope this helps, feel free to copy the Notebook from this link:

  2. Great, thanks. I think the installation instructions have changed and references to install-extras have been removed.