Can't create package for windows with kivy 1.9 portable
See original GitHub issueI’m looking to port an existing kivy 1.8 project to kivy 1.9. I’ve just downloaded the portable version and have the application working.
However when packaging the app using pyinstaller and the instructions on http://kivy.org/docs/guide/packaging-windows.html the app packages, but on execution immediately fails with error:
Traceback (most recent call last):
File "<string>", line 34, in <module>
ImportError: No module named pygame.pkgdata
I’ve tried using my old .spec file and generating a new one with exactly the same results.
I’m a bit mystified where this is coming from as pygame isn’t imported anywhere in my application and I thought it had been replaced with sdl2 in kivy 1.9. I’m also confused that the application works when run directly.
Anyone come across this issue or can point me in the right direction?
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
python - Kivy - Create package on Windows - Stack Overflow
I managed to find a way to solve my problem. I tried to add the "six" package to the hidden_imports, but then it...
Read more >Create a package for Windows — Kivy 2.1.0 documentation
This document only applies for kivy 1.9.1 and greater. Packaging your application for the Windows platform can only be done inside the Windows...
Read more >Kivy Documentation - Read the Docs
Kivy is an open source software library for the rapid development of applications equipped with novel user interfaces, such as multi-touch apps.
Read more >[PyInstaller,Windows] ImportError (pygame.pkgdata) running ...
I got "past" the missing pygame.pkgdata by installing pygame 1.9.1 through the installer on their website, but now the application crashes with critical...
Read more >kivy python - You.com | The Search Engine You Control
Build and distribute beautiful Python cross-platform GUI apps with ease. ... The Kivy package on windows includes a portable python installation with Kivy...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @h-sol & @matham - manually copying
libpng16-16.dll
gets me past the SDL2 error and the application mostly runs okay now.I’m still running into the problem that numpy / opencv don’t seem to be being imported and so the application fails on camera start. I’m confused by this as other imported libraries (e.g. peewee) are importing fine. Any pointers?
I originally encountered the following error when using the instructions at http://kivy.org/docs/guide/packaging-windows.html
I am using the portable version of
1.9.0
on Windows 7, 64-bit.Here is a solution:
Open
Kivy-1.9.0-py2.7-win32-x64\kivy27\kivy\tools\packaging\pyinstaller_hooks\rt-hook-kivy.py
in a text-editor. Delete everything in the file, copy the contents of https://github.com/kivy/kivy/blob/master/kivy/tools/packaging/pyinstaller_hooks/rt-hook-kivy.py into it, and save it.Build the specfile again, and you should have a working
exe
in thedist
folder.Ref: https://github.com/kivy/kivy/issues/3308#issuecomment-97172322 Thanks @jtownley!
HTH