DataPortal Excel File Data Error: OSError: Unknown file format 'xlsx'

280 views
Skip to first unread message

Emmanuel Twum

unread,
Jun 28, 2021, 2:27:07 AM6/28/21
to Pyomo Forum
Team Pyomo,
I am getting the abovementioned error when I run my model in an attempt to read in data from my excel file and solve the model. I have doubled checked the excel file extensions in the documentation, and '.xlsx' is a valid format (Data sources: csv, tab, odbc, xls/xlsm/xlsb/xlsx, yaml, json, xml, and Pyomo data command files).

But the 'Dataportal()' is constantly throwing the abovementioned error. I would be glad for your guidance in this matter. I have attached the two files for your convenience.

Thank you. 

extract_model.py
ex_data_file.xlsx
Message has been deleted

Emmanuel Twum

unread,
Jun 28, 2021, 8:35:47 AM6/28/21
to pyomo...@googlegroups.com
Thanks a bunch, Philipp. That did fix the problem. 

On Mon, 28 Jun 2021 at 01:37, Philipp Erfurth <erfurth...@gmail.com> wrote:

I am assuming that you have just installed Pyomo 6.0.1…

 

The short answer is to install the pyutilib package.

 

6.0, as a major release, is not 100% backwards compatible with the 5.x series.  One of the (many) things that 6.0 does is remove the hard dependency on PyUtilib.  While most of that functionality was ported into / redesigned in Pyomo, the one thing that was not brought over was the excel support for DataPortals.  Porting that code over from PyUtilib would have been a significant undertaking (both in refactoring and in testing it at the current level required by Pyomo).  Combined with the availability of significantly improved options for interfacing with Excel since DataPortals was written (notable the Pandas package), we felt that most users would be better served migrating to a Pandas-based interface for interacting with Excel.  We did not remove the excel interfaces for DataPortals, but they will not report being active/available unless you have (manually) installed the - now optional - pyutilib dependency.

 

Philipp


--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/a7a5361b-00ef-4275-8324-9504119e6c58n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/CADPO6A2UC5KWJjhd7Lh%2BVpmfMnSG7X9FAte0GFZ5%2B_hP2c-5vw%40mail.gmail.com.


--
Best Regards!

Mr. Emmanuel Twum
Managing Director/CEO
Company email: wemus...@gmail.com
Mobile USA: +12675703062 | UK:+441618187529 | Ghana: +233203354322 

Reply all
Reply to author
Forward
0 new messages