在kivy官網(wǎng)有篇介紹打包kivy應(yīng)用的文章 傳送門: Programming Guide ? Create a package for Windows 我照葫蘆畫(huà)瓢,原樣復(fù)制了代碼,和步驟!打包成功!但是運(yùn)行報(bào)錯(cuò)。
Traceback (most recent call last):File "site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 11, in <module>File "c:\users\wxg\appdata\local\temp\pip-build-px2be5\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 389, in load_moduleFile "build\bdist.win-amd64\egg\pkg_resources\__init__.py", line 48, in <module>File "build\bdist.win-amd64\egg\pkg_resources\extern\__init__.py", line 60, in load_module
ImportError: The 'six' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.
Failed to execute script pyi_rth_pkgres
沒(méi)six這個(gè)包。把ImportError: The 'six' package is required;作為關(guān)鍵字拿去搜索,最靠譜的一個(gè)答案是 stackoverflow 上的 Kivy - Create package on Windows 有人提到把 setuptools 的版本降低到 19.2 ,其實(shí)沒(méi)必要。 至少在我的系統(tǒng)上,我沒(méi)有降低版本,也成功了。我的是 19.6.2 如下:
Tree('C:\\Users\\wxg\\PycharmProjects\\untitled\\demo\\helloworld\\'),
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
改完后是這個(gè)樣子的:
coll = COLLECT(exe, Tree('C:\\Users\\wxg\\PycharmProjects\\untitled\\demo\\helloworld\\'),a.binaries,a.zipfiles,a.datas,*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],strip=False,upx=True,name='helloKivy')