ecco
ecco

Reputation: 53

compile tkinter to executable using py2exe, having issue with xlrd

I made a GUI using tkinter. My GUI is linked to an Excel file so I used the xlrd package. After compiling the GUI to executable using py2exe, when I try to open the executable file I get a text file with the following error message:

Traceback (most recent call last):
  File "main.py", line 2, in <module>
  File "xlrd\__init__.pyc", line 4, in <module>
IOError: [Errno 2] No such file or directory: 'C:\\Users\\dist\\library.zip\\xlrd\\version.txt'

I have no idea what that "version.txt" file is or why it doesn't exist in the directory. I have tried to compile an executable GUI that doesn't need the xlrd package and everything worked fine. This is my setup.py file script:

from distutils.core import setup
import py2exe

setup(windows=['main.py'],options={'py2exe':{'includes':['xlrd']}})

I'm fairly new to python and making executable applications. Any advice is appreciated.

Upvotes: 1

Views: 873

Answers (1)

John Machin
John Machin

Reputation: 82934

The version of xlrd that you are using is out of date; version.txt has been eradicated.

Try the first one of the following versions that meets your requirements:

0.9.0 -- XLS and XLSX files, Python 2.6. 2.7, 3.2+
0.8.0 -- XLS and XLSX files, Python 2.3 to 2.7
0.7.9 -- XLS files only, Python 2.1 to 2.7

Note: The released 0.9.0 is not production quality; several bugs have been fixed in the master branch so get a ZIP file from github using the link above, not the tar.gz from PyPI.

Upvotes: 1

Related Questions