Kivy - create a package on Windows

Greetings to all and thank you for taking the time to help me.

I am currently trying to create a Windows package for my Kivy application (1.9.1) using PyInstaller (3.1). I followed the instructions from the documentation, but could not get it to work. So I tried using the "touchtracer" demo application as an example with the same results. I get the following error:

Traceback (most recent call last):
  File "<string>", line 11, in <module>
  File "f:\temp\pip-build-1elcla\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 48, in <module>
    from pkg_resources.extern import six
  File "C:\Python27\lib\site-packages\pkg_resources\extern\__init__.py", line 60, in load_module
    "distribution.".format(**locals())
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.

pyi_rth_pkgres returned -1

This is my .spec file:

# -*- mode: python -*-
from kivy.deps import sdl2, glew

block_cipher = None


a = Analysis(['C:\\Python27\\share\\kivy-examples\\demo\\touchtracer\\main.py'],
             pathex=['C:\\Users\\PC\\Documents\\Njord\\njord\\Nouveau dossier'],
             binaries=None,
             datas=None,
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=True,
          name='touchtracer',
          debug=False,
          strip=False,
          upx=True,
          console=True )
coll = COLLECT(exe, Tree('C:\\Python27\\share\\kivy-examples\\demo\\touchtracer\\'),
               a.binaries,
               a.zipfiles,
               a.datas,
               *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
               strip=False,
               upx=True,
               name='touchtracer')

I tried with Kivy packages installed from pip and with a wheel, without success. Does anyone have an explanation?

Thanks again.

+4
source share
2 answers

. "six" hidden_imports, "", .

setuptools 19.4 , , "six" hidden_imports, , . , , setuptools 19.4 19.2. , kivy.app, , .

kivy hidden_imports spec , , , . (sqlalchemy, sqlalchemy.orm, uuid).

: setuptools, , 19.2. hidden_imports, kivy.

+3

, .

         hiddenimports=['six','packaging','packaging.version','packaging.specifiers'],
+1

Source: https://habr.com/ru/post/1625219/


All Articles