CGFoX CGFoX - 11 months ago 52
Python Question

Installing/Running Pyomo (command not found)

I installed Pyomo on my Ubuntu 15.10 according to the install guide using

pip install pyomo
which worked fine and returned
Successfully installed pyomo PyUtilib appdirs ply nose six
. (I installed pip and scientific python first.)

However, if I now test it with
pyomo --help
, I get
pyomo: command not found

Am I missing something? Do I somehow need to add pyomo to my path?

Am I not running it correctly? In the quick start it mentioned to import pyomo.core in python. I tried that but it didn't change anything.

Answer Source

pip is installing into your user-writeable $HOME/.local which is very likely just missing from you $PATH and $PYTHONPATH where linux looks for scripts to execute and python looks for modules to import respectively.

Execute in a terminal session and try again:

export PATH=${HOME}/.local/bin:${PATH}
export PYTHONPATH=${HOME}/.local/lib/python2.7/site-packages:${PYTHONPATH}

If that helps, add those commands at the bottom of your $HOME/.bashrc so they get executed whenever you start a terminal session.