importerror:没有名为kwallet的模块

时间:2017-11-20 16:11:58

标签: python py2exe

当我使用以下回溯收到此错误时,我正在使用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"]}}
)

我正在使用带有python 2.7的Windows 10 我做了一些挖掘,但没有用。我没有找到与py2exe这个错误的任何确切或近似匹配。非常感谢。

1 个答案:

答案 0 :(得分:0)

错误是因为py2exe无法动态定位&#34; kwallet&#34;模块。

kwallet位于&#34; keyring.backends&#34;

我在使用cx-freeze时有类似的问题,我通过明确定义它来解决它。

对于cx_freeze

packages=['atexit', "PySide", "jenkins", "packaging", 'client', 'keyring.backends.kwallet',
                               "keyring.backends.OS_X", "keyring.backends.SecretService",
                               "keyring.backends.Windows", "vulcantoolkit"]