Issue with exportData() with amplpy==0.14.0

Hi!
I recently updated amplpy version to the latest 0.14.0 and now I get the following error when I call the ampl.exportData():

File “C:\Users\MS3118\Repos\optimization-module\OPT-12\Lib\site-packages\amplpy\ampl.py”, line 803, in export_data
return self.snapshot(filename, model=False, data=True, options=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\MS3118\Repos\optimization-module\OPT-12\Lib\site-packages\amplpy\ampl.py”, line 819, in snapshot
return self._impl.snapshot(filename, model, data, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: file -
line 1 offset 9
syntax error
context: snapshot >>> data; <<<

I did not change the syntax when migrating to the new amplpy version and I was not getting the above error.

Thanks for the support in advance

Hi @marina.santarelli,

Thank you for reaching out. That error usually happens when an outdate version of AMPL is installed with a more recent version of amplpy. Could you please install the latest version of AMPL and try again?

1 Like

Thanks a lot, issue solved!