Error on test run: AttributeError from 'AbstractModel'

202 views
Skip to first unread message

Mathieu Saurat

unread,
Dec 16, 2015, 11:51:42 AM12/16/15
to Temoa Project
Hello,

I am new to Temoa. I am running Ubuntu 12.04 on a virtual machine (Parallels) on Mac OS 10.8.5. I have Python 2.7.11, Anaconda 2.4.1 (64-bit), Pyomo 4.2.10784 (CPython 2.7.11 on Linux 3.2.0-94-generic), GLPK, and the temoa model (temoa.py and example_data_sets downloaded from the website, not GitHub) installed. When I test run Temoa with any of the data files from example_data_sets, I get the following:

parallels@parallels-Parallels-Virtual-Platform:~/Python/TEMOA$ python temoa.py example_data_sets/temoa_island.dat
Notice: Using the GLPK solver interface.
[    0.06] Reading data files.
[        ] Creating Temoa model instance.WARNING: DEPRECATION WARNING: the Model.create() method is deprecated.  Call Model.create_instance() if to create a concrete model from an abstract model.  You do not need to call Model.create() for a concrete model.
[    1.51
[    2.82] Solving.
[        ] Calculating reporting variables and formatting results.Traceback (most recent call last):
  File "/home/parallels/anaconda2/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/parallels/anaconda2/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "temoa.py/__main__.py", line 26, in <module>
  File "temoa.py/temoa_lib.py", line 2104, in temoa_solve
  File "temoa.py/temoa_lib.py", line 1567, in solve_perfect_foresight
AttributeError: 'AbstractModel' object has no attribute 'update_results'

Any idea on what may have happened and what I need to change to be able to run Temoa?

Best,
Mathieu

Mathieu Saurat

unread,
Dec 17, 2015, 11:17:35 AM12/17/15
to Temoa Project
In case somebody else runs into the same problem, here is the fix that worked for me: using the most updated code from github.
The code can be downloaded directly as a zip file from https://github.com/TemoaProject/temoa (click the "Download ZIP" button on the righthand side) or by using git clone. How to run the code is then explained in the READ_ME file.

Best
Mathieu

Joe

unread,
Dec 17, 2015, 11:43:34 AM12/17/15
to Temoa Project
Hi Mathieu,

Glad you were able to get it working. Just to confirm, the zip file available through temoaproject.org is currently out of date. For users who would like the most updated code but don't want to install Git and clone, you can go to our github page (https://github.com/TemoaProject/temoa) and click the "Download ZIP" button on the righthand side.

In the meantime, we'll work to get the website version updated.

Thanks,
Joe
Message has been deleted

Joe

unread,
Jan 2, 2018, 8:07:17 AM1/2/18
to Temoa Project
Hi Hayford,

The attached error looks like it is related to pyomo. Try running "pyomo solve" from the command line. It should return information on how to run a model. If that command returns an error, then there is a more basic problem with the installation.

Also, just a warning that the latest version of pyomo broke the Temoa code. We will be updating the code soon, but in the meantime, I suggest running pyomo 4.2. (I'm currently running 4.2.10784.)

Best,
Joe



On Tuesday, January 2, 2018 at 7:58:42 AM UTC-5, Hayford Adjavor wrote:
Hello all, 
Mathieu thanks for the tips on this issue. I am new to PYOMO, and I have just run into this problem (see attached screenshot). However, I am a PC user. Any chance anyone can help solve this issue.

Thanks

def

unread,
Jan 21, 2018, 7:14:46 PM1/21/18
to Temoa Project

Hello,

I got some difficulties to run the model with command line. It seems to be ok with the web interface. I am using pyomo 5.3 and it doesnt work. What should I do ?

Best,

def

unread,
Jan 21, 2018, 7:15:03 PM1/21/18
to Temoa Project

Hello,

I am using pyomo 5.3 I used the README.txt file instructions to run the model and didn't succeed. It seems to be ok online with the web interface. What should I do to have the model run with command line ?

Best,

Joe

unread,
Jan 21, 2018, 7:17:21 PM1/21/18
to Temoa Project
The latest version of Pyomo broke our model. I hope to resolve this soon. If you downgrade to Pyomo 4.2, it should work fine. I'm currently running Pyomo 4.2.10784 and Temoa works fine. Let me know if that solves the problem.

Best,
Joe
Reply all
Reply to author
Forward
0 new messages