【发布时间】:2013-06-14 07:11:16
【问题描述】:
我在将 Python 2.7 超级简单脚本冻结为独立应用程序时遇到了问题。
我使用 Spynner 完全没有问题,但是当我尝试冻结我的超级简单脚本时:
from spynner import *
在 CMD 中打开“test.exe”时出现以下错误:
C:\Python27\Scripts\MY\build\exe.win32-2.7>test.exe
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", li
exec code in m.__dict__
File "test.py", line 1, in <module>
File "C:\Python27\lib\site-packages\spynner-2.4-py2.7.egg\spynner\__init_
from browser import *
File "C:\Python27\lib\site-packages\spynner-2.4-py2.7.egg\spynner\browser
class Browser(object):
File "C:\Python27\lib\site-packages\spynner-2.4-py2.7.egg\spynner\browser
pkg_resources.resource_filename('spynner', 'javascript'),
File "build/bdist.linux-i686/egg/pkg_resources.py", line 882, in resource
File "build/bdist.linux-i686/egg/pkg_resources.py", line 1344, in get_res
NotImplementedError: resource_filename() only supported for .egg, not .zip
提前感谢您的任何想法。
【问题讨论】:
-
这里还有一个截图,描述了我上面提到的问题。 img96.imageshack.us/img96/9018/vfrs.png
-
spynner 正在使用一种存储数据文件的方式,这种方式在冻结为 zip 文件时无法使用。您必须对其进行修补以在您指定的位置查找其 javascript 文件。
标签: python-2.7 cx-freeze spynner