Packaging kivy app on linux

96 views
Skip to first unread message

Majd Suliman

unread,
Apr 13, 2022, 7:01:22 AM4/13/22
to Kivy users support
Hello guys,

I have created a UI for a printer that uses raspberry pi. When it comes to packaging the  app, the documentation doesn't seem to support Linux, however there are some unofficial approaches such as (http://docs.python.org/2/distutils/builtdist.html or http://www.pyinstaller.org/).

so my question , is it a good idea to stick to this framework for long-term commercial implementation of the GUI ?

Elliot Garbus

unread,
Apr 13, 2022, 10:22:46 AM4/13/22
to kivy-...@googlegroups.com

Is it a good idea to stick to this framework for long-term commercial implementation of the GUI?

 

My answer is yes.

To answer this question you would need to assess your view of the risks associated with the project and your needs going forward.

Things to consider:

  • Licensing terms -  Kivy use a permissive MIT open source license
  • Project activity – The project has an active community and is regularly updated.
  • Project longevity – The project has been around for over 10 years has a team of maintainers and has had changes in maintainers over the project lifetime.
  • Good documentation – Strong set of documents and examples.
  • Active community – This site, Reddit, Discord all have significant activity.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/4be003e1-2dde-4fdc-bbf2-31a666146d27n%40googlegroups.com.

 

Robert

unread,
Apr 13, 2022, 1:14:51 PM4/13/22
to Kivy users support
On Linux you can be pretty certain Python is installed. So package with setuptools and install with pip3.

Majd Suliman

unread,
Apr 14, 2022, 6:44:29 AM4/14/22
to Kivy users support
Thank you all.
I have yet another issue I am dealing with. My program contains multiple directories, python, and kv files. I would like to package it so the source code won't be available to the user, so I tried using pyinstaller which packages the program but I had this error: 

1.PNG

So is it a problem with the spec file not having the directories stated in there ?

Elliot Garbus

unread,
Apr 14, 2022, 2:47:59 PM4/14/22
to kivy-...@googlegroups.com

I have no idea what the specific problem is.  Here is the spec file I use for Windows programs, the file for Mac is very similar, and I expect Linux would also be almost the same.

 

Check that you are using the “datas” section correctly.

For this project I created a ProjectDist directory under the project directory.  I keep the spec files there, and the build and dist directories are created under this dir.  This is important when considering the relative paths I am using below.

 

This spec file creates a one_dir build.  I would suggest getting things running under a one directory build first.

 

 

# -*- mode: python -*-

import os
from kivy_deps import sdl2, glew

spec_root = os.path.abspath(SPECPATH)
block_cipher =
None
app_name = 'YourAppName'
win_icon = '../Images/icon.ico'

a = Analysis(['../main.py'],
            
pathex=[spec_root],
            
binaries=[],
            
datas=[('../*.kv', '.'),
                    (
'../Images/*.png', './Images')],
            
hiddenimports=[],
            
hookspath=[],
            
runtime_hooks=[],
            
excludes=[],
            
win_no_prefer_redirects=False,
            
win_private_assemblies=False,
            
cipher=block_cipher,
            
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
            
cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          [],
         
exclude_binaries=True,
         
name=app_name,
         
debug=False,
         
bootloader_ignore_signals=False,
         
strip=False,
         
upx=False,
         
console=False,
         
icon=win_icon)
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               *[Tree(p)
for p in (sdl2.dep_bins + glew.dep_bins)],
              
strip=False,
              
upx=False,
              
name=app_name)

 

 

 

 

From: Majd Suliman
Sent: Thursday, April 14, 2022 3:44 AM
To: Kivy users support

Subject: [kivy-users] Re: Packaging kivy app on linux

 

Thank you all.

I have yet another issue I am dealing with. My program contains multiple directories, python, and kv files. I would like to package it so the source code won't be available to the user, so I tried using pyinstaller which packages the program but I had this error: 

 

 

So is it a problem with the spec file not having the directories stated in there ?

 

 

On Wednesday, April 13, 2022 at 7:14:51 PM UTC+2 Robert wrote:

On Linux you can be pretty certain Python is installed. So package with setuptools and install with pip3.

On Wednesday, April 13, 2022 at 1:01:22 AM UTC-10 majd.sul...@gmail.com wrote:

Hello guys,

 

I have created a UI for a printer that uses raspberry pi. When it comes to packaging the  app, the documentation doesn't seem to support Linux, however there are some unofficial approaches such as (http://docs.python.org/2/distutils/builtdist.html or http://www.pyinstaller.org/).

 

so my question , is it a good idea to stick to this framework for long-term commercial implementation of the GUI ?

--

You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.

1.PNG
Reply all
Reply to author
Forward
0 new messages