本文介绍了cxFreeze错误:resource_filename()仅支持.egg而不支持.zipp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个完全工作的基于wxpython的应用程序,所有的Python。
我想要一个exe,所以我使用cxFreeze。



在构建过程中,有很多模块似乎缺失,有时不应该一个问题,但是当我运行应用程序它给我一个错误MySQLdb模块:

  NotImplementedError:resource_filename .egg not .zip 



我在Python 2.7 / Lib / Site-Packages下有一个.egg



任何帮助或建议都非常感激。



谢谢!




  1. 转到您的python目录,然后到site-packages,
    对我来说是C:\Python27\Lib\site-packages

  2. 创建一个新文件夹并复制的MySQLdb egg文件,只是为了保存它在任何情况下,你可能需要恢复它以后。 (ex MySQL_python-1.2.3-py2.7-win32.egg)

  3. 将MySQL_python-1.2.3-py2.7-win32.egg重命名为MySQL_python-1.2.3-py2。


  4. 添加.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:

  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.

这篇关于cxFreeze错误:resource_filename()仅支持.egg而不支持.zipp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 20:12