问题
I have a fully working wxpython based application, written all in Python. I wanted to make an exe, so I used cxFreeze.
During the build, there are many modules which seem to be missing, which sometimes should not make a problem, but when I run the application it gives me an error from MySQLdb module:
NotImplementedError: resource_filename() only supported for .egg not .zip
I have a .egg for MySQL at Python 2.7 / Lib / Site-Packages.
Any help or suggestions are highly appreciated.
Thanks!
回答1:
For anyone having the same problem in the future:
- Go to your python directory and then to the site-packages, for me was C:\Python27\Lib\site-packages
- Create a new folder and make a copy of your MySQLdb egg file there just to save it in any case you might need to recover it later. (ex MySQL_python-1.2.3-py2.7-win32.egg)
- rename MySQL_python-1.2.3-py2.7-win32.egg to MySQL_python-1.2.3-py2.7-win32.zip and unzip it in place.
- add .egg to the unzipped folder
This worked for me with cxfreeze. Now my executable is running.
来源:https://stackoverflow.com/questions/25872134/cxfreeze-error-resource-filename-only-supported-for-egg-not-zipp