简体   繁体   中英

cxFreeze error: resource_filename() only supported for .egg not .zipp

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!

For anyone having the same problem in the future:

  1. Go to your python directory and then to the site-packages, for me was C:\\Python27\\Lib\\site-packages
  2. 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)
  3. 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.
  4. add .egg to the unzipped folder

This worked for me with cxfreeze. Now my executable is running.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM