Skip to content

Instantly share code, notes, and snippets.

@jckantor
Last active May 28, 2019 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jckantor/1ab449b51159b80a84b52d7a3de0f98d to your computer and use it in GitHub Desktop.
Save jckantor/1ab449b51159b80a84b52d7a3de0f98d to your computer and use it in GitHub Desktop.
import sys, shutil
if 'google.colab' in sys.modules:
!pip install -q pyomo
!wget -N -q "https://ampl.com/dl/open/ipopt/ipopt-linux64.zip"
!unzip -o -q ipopt-linux64
ipopt_executable = '/content/ipopt'
else:
ipopt_executable = shutil.which('ipopt')
if ipopt_executable is None:
raise FileNotFoundError('Could not locate the ipopt executable.')
print('Using the ipopt executable located at:', ipopt_executable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment