Pyinstaller compile to exe

前端 未结 8 1358
旧时难觅i
旧时难觅i 2021-01-18 02:09

I am trying to compile a Kivy application to a windows exe, but I keep receiving an attribute error: AttributeError: \'str\' object has no attribute \'items\'

I have

8条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-18 02:54

    I have faced some similar error when I use pyinstaller. And part of my error message are showed following:

    File "C:\Python27\lib\site-packages\pyinstaller-3.1.1-py2.7.egg\PyInstaller\depend\analysis.py", line 198, in _safe_import_module
      hook_module.pre_safe_import_module(hook_api)
    File "C:\Python27\lib\site-packages\pyinstaller-3.1.1-py2.7.egg\PyInstaller\hooks\pre_safe_import_module\hook-six.moves.py", line 55, in pre_safe_import_module
      for real_module_name, six_module_name in real_to_six_module_name.items():
    AttributeError: 'str' object has no attribute 'items'
    

    When I scroll up this message, I found this:

    18611 INFO: Processing pre-find module path hook   distutils
    20032 INFO: Processing pre-safe import module hook   _xmlplus
    23532 INFO: Processing pre-safe import module hook   six.moves
    Traceback (most recent call last):
      File "", line 2, in 
    ImportError: No module named six
    

    So I turned to install the module six. And when I installed it, my pyinstaller could run successfully.

    Hope this can help you.

提交回复
热议问题