user3376020
user3376020

Reputation:

module 'pyomo' has no attribute 'AbstractModel'

I have installed pyomo and trying to create a instance model from AbstractModel as follows:

import pyomo as pmo

absmd = pmo.AbstractModel() Traceback (most recent call last):

File "", line 1, in absmd = pmo.AbstractModel()

But i am getting the following error:

AttributeError: module 'pyomo' has no attribute 'AbstractModel'

Any advise?

Upvotes: 0

Views: 1314

Answers (1)

Joost
Joost

Reputation: 3729

You're importing the wrong stuff. Either use pmo.environ.AbstractModel() or

from pyomo.environ import *
model = AbstractModel()

Upvotes: 2

Related Questions