我正在尝试为Windows打包 kivy 应用程序,并且在按照示例TouchTracer应用程序的Kivy website中的说明操作后,我在尝试时收到ImportError: No Module named ConfigParser
消息打开dist文件夹中的.exe文件。
我正在运行Python 2.7.11和kivy 1.9.1。
此外,在执行命令python -m PyInstaller...
时,输出包含一行:
12612 WARNING: Attempted to add Python module twice with different upper/lowercases: ConfigParser
以下是尝试打开.exe文件时打印的回溯。
Traceback (most recent call last):
File "C:\Users\acasall1\Desktop\TouchApp\demo\touchtracer\main.py", line 22,
in <module>
import kivy
File "c:\users\acasall1\appdata\local\temp\pip-build-21skkd\pyinstaller\PyIns
taller\loader\pyimod03_importers.py", line 389, in load_module
File "c:\python27\lib\site-packages\kivy\__init__.py", line 306, in <module>
from kivy.config import Config
File "c:\users\acasall1\appdata\local\temp\pip-build-21skkd\pyinstaller\PyIns
taller\loader\pyimod03_importers.py", line 389, in load_module
File "c:\python27\lib\site-packages\kivy\config.py", line 284, in <module>
from configparser import RawConfigParser as PythonConfigParser
File "c:\users\acasall1\appdata\local\temp\pip-build-21skkd\pyinstaller\PyIns
taller\loader\pyimod03_importers.py", line 389, in load_module
File "C:\Python27\lib\site-packages\configparser\__init__.py", line 5, in <mo
dule>
from ConfigParser import *
ImportError: No module named ConfigParser
Failed to execute script main
答案 0 :(得分:1)
我的kivy应用程序遇到了同样的问题,我找到了一个临时解决方案。该错误来自&#34; import kivy&#34;,因此取消注释它和下一行&#34; kivy.require(&#39; 1.0.6&#39;)&#34;。如果您的kivy版本正确,则不需要行。