0

i am new to python, i found py2exe and used it on a small test python code and it worked fine. i have now created a program that uses openpyxl library for excel spreadsheets. when i compile to .exe using py2exe i get no errors, however when i try and execute the new .exe i get the following in a log file and on console for my new .exe

Traceback (most recent call last):
  File "pdf_to_excel.py", line 2, in <module>
  File "openpyxl\__init__.pyo", line 29, in <module>
  File "openpyxl\workbook\__init__.pyo", line 5, in <module>
  File "openpyxl\workbook\workbook.pyo", line 16, in <module>
  File "openpyxl\writer\write_only.pyo", line 23, in <module>
  File "openpyxl\writer\excel.pyo", line 36, in <module>
  File "openpyxl\packaging\extended.pyo", line 4, in <module>
ImportError: cannot import name __version__

i checked c:\python27\lib\site-packages it contains "openpyxl" and "openpyxl-2.4.4-py2.7.egg"

i am not sure why i am getting the backtrace or how to fix this?

john johnson
  • 699
  • 1
  • 12
  • 34

1 Answers1

0

https://bitbucket.org/openpyxl/openpyxl/issues/633/compatibility-with-pyinstaller

I've not tried it, but try comment #2.

Eirene
  • 26
  • 3
  • thanks for that suggestion, that lead me to --hidden-import from another post. http://stackoverflow.com/questions/27947639/how-to-properly-create-a-pyinstaller-hook-or-maybe-hidden-import so i used --hidden-import=openpyxl , i assume the link you gave me would work for having multiple modules you need to import :) – john johnson Mar 04 '17 at 20:16