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

ⅰ亾dé卋堺 提交于 2019-12-02 01:51:05

问题


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:

  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.



来源:https://stackoverflow.com/questions/25872134/cxfreeze-error-resource-filename-only-supported-for-egg-not-zipp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!