当我使用py2exe试图为我的python程序构建一个exe文件时,我收到了这个错误,并带有以下回溯。
Traceback (most recent call last):
File "orchestrator.py", line 49, in <module>
import process_text as proc
File "process_text.pyc", line 14, in <module>
File "utilfuncs.pyc", line 5, in <module>
File "browsercookie\__init__.pyc", line 30, in <module>
File "keyring\__init__.pyc", line 6, in <module>
File "keyring\core.pyc", line 148, in <module>
File "keyring\core.pyc", line 64, in init_backend
File "keyring\util\__init__.pyc", line 20, in wrapper
File "keyring\backend.pyc", line 179, in get_all_keyring
File "keyring\backend.pyc", line 139, in _load_backends
File "keyring\backend.pyc", line 131, in _load_backend
File "importlib\__init__.pyc", line 37, in import_module
ImportError: No module named kwallet我的主模块(包含main的模块)称为orchestrator。我的setup.py如下所示
from distutils.core import setup
import py2exe
setup(
console=['orchestrator.py'],
options = {"py2exe":{"includes":["browsercookie"]}}
)我使用的是windows10和python2.7,我做了一些调查,但是没有用。我在py2exe中找不到任何与此错误完全匹配或相近的匹配项。在此之前非常感谢。
发布于 2018-02-21 03:02:13
这个错误是因为py2exe不能动态定位"kwallet“模块。
kwallet位于"keyring.backends“中
我在使用cx-freeze时遇到了类似的问题,我通过明确地定义它来解决它。
对于cx_freeze
packages=['atexit', "PySide", "jenkins", "packaging", 'client', 'keyring.backends.kwallet',
"keyring.backends.OS_X", "keyring.backends.SecretService",
"keyring.backends.Windows", "vulcantoolkit"]https://stackoverflow.com/questions/47396339
复制相似问题