question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't create package for windows with kivy 1.9 portable

See original GitHub issue

I’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:closed
  • Created 8 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jamiecollinsoncommented, Apr 20, 2015

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?

0reactions
pradeepcepcommented, Jul 5, 2015

I originally encountered the following error when using the instructions at http://kivy.org/docs/guide/packaging-windows.html

Traceback (most recent call last):
  File "<string>", line 34, in <module>
ImportError: No module named pygame.pkgdata

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 the dist folder.

Ref: https://github.com/kivy/kivy/issues/3308#issuecomment-97172322 Thanks @jtownley!

HTH

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found