问题描述
我有一个完全工作的基于wxpython的应用程序,所有的Python。
我想要一个exe,所以我使用cxFreeze。
在构建过程中,有很多模块似乎缺失,有时不应该一个问题,但是当我运行应用程序它给我一个错误MySQLdb模块:
NotImplementedError:resource_filename .egg not .zip
我在Python 2.7 / Lib / Site-Packages下有一个.egg
任何帮助或建议都非常感激。
谢谢!
- 转到您的python目录,然后到site-packages,
对我来说是C:\Python27\Lib\site-packages - 创建一个新文件夹并复制的MySQLdb egg文件,只是为了保存它在任何情况下,你可能需要恢复它以后。 (ex MySQL_python-1.2.3-py2.7-win32.egg)
- 将MySQL_python-1.2.3-py2.7-win32.egg重命名为MySQL_python-1.2.3-py2。
添加.egg到解压缩的文件夹
p>这对我有用cxfreeze。现在我的可执行文件正在运行。
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:
- 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.
这篇关于cxFreeze错误:resource_filename()仅支持.egg而不支持.zipp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!