Skip to content

howto install pyomo local

Ludovico Bianchi edited this page May 18, 2023 · 1 revision

How to install Pyomo from a local Git clone

These steps assume that:

  • A local Git clone of IDAES exists at /home/myuser/proj/idaes/idaes-pse
    • We want to work on a branch called my-idaes-branch
  • A local Git clone of Pyomo exists at /home/myuser/proj/idaes/pyomo
    • We want to work on a branch called new-pyomo-feature

1. Create or activate your IDAES dev environment

  • When in doubt, it's generally safer to create a new environment
conda create -n idaes-with-dev-pyomo python=3.10 && conda activate idaes-with-dev-pyomo

2. Install IDAES

cd /home/myuser/proj/idaes/idaes-pse
git checkout my-idaes-branch
pip install -r requirements-dev.txt

3. Uninstall the version of Pyomo that was installed automatically with IDAES

pip uninstall --yes pyomo

4. Reinstall Pyomo using the local Git clone

cd /home/myuser/proj/idaes/pyomo
git checkout new-pyomo-feature
pip install --editable .

5. Confirm that the right version of Pyomo has been installed

pip show pyomo
# the output should contain Location: /home/myuser/proj/idaes/pyomo
Clone this wiki locally