Unable to create package for OS X

76 views
Skip to first unread message

Grant

unread,
Jun 19, 2019, 12:30:35 PM6/19/19
to Kivy users support
I have installed Kivy3 version 1.11.0 in my applications folder.

Then executed buildozer init successfully, modified the buildozer.spec file.

But buildozer osx debug fails:

$ buildozer osx debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for osx
# Check if kivy-sdk-packager exists
# kivy-sdk-packager found at <path>/.buildozer/osx/platform
# check if Kivy.app exists in local dir
# Kivy.app found at <path>/.buildozer/osx/platform/kivy-sdk-packager-master/osx
# Install platform
# Check application requirements
# Remove directory and subdirectory <path>/.buildozer/applibs
# Create directory <path>/.buildozer/applibs
# Run 'bash -c "source venv/bin/activate && env"'
# Cwd <path>/.buildozer
TERM_PROGRAM=iTerm.app
TERM=xterm
SHELL=/bin/bash
TMPDIR=/var/folders/nb/7vbm_q2x1lg4xq7jkg04g67h0000gq/T/
CONDA_SHLVL=1
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.c58z3KKR5I/Render
CONDA_PROMPT_MODIFIER=(kivyapp)
TERM_PROGRAM_VERSION=3.2.9
TERM_SESSION_ID=w0t0p0:F95B8507-945A-4994-8993-F692EA814D10
USER=grpieter
CONDA_EXE=/Users/grpieter/anaconda/bin/conda
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.sXOJuoEUqo/Listeners
__CF_USER_TEXT_ENCODING=0x1F7:0x0:0x0
VIRTUAL_ENV=/Users/grpieter/Desktop/Cisco/CLUS19_dcloudapp/.buildozer/venv
PATH= <path>/.buildozer/venv/bin:/Users/grpieter/anaconda/envs/kivyapp/bin:/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/Users/grpieter/anaconda/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/grpieter/Desktop/nand2tetris/tools
CONDA_PREFIX=/Users/grpieter/anaconda/envs/kivyapp
PWD=<path>/.buildozer
LANG=en_US.UTF-8
ITERM_PROFILE=Default
XPC_FLAGS=0x0
PS1=(venv)
XPC_SERVICE_NAME=0
PACKAGES_PATH=/Users/grpieter/.buildozer/osx/packages
SHLVL=3
HOME=/Users/grpieter
COLORFGBG=7;0
ITERM_SESSION_ID=w0t0p0:F95B8507-945A-4994-8993-F692EA814D10
CONDA_PYTHON_EXE=/Users/grpieter/anaconda/bin/python
PYTHONPATH=/Users/grpieter/Desktop/Stuff/Advanced Pyton/student_files/
LOGNAME=grpieter
CONDA_DEFAULT_ENV=kivyapp
DISPLAY=/private/tmp/com.apple.launchd.fGmzQCWPVq/org.macosforge.xquartz:0
SECURITYSESSIONID=186a8
COLORTERM=truecolor
_=/usr/bin/env
# Install requirement python3 in virtualenv
# Run 'pip install --target=<path>/.buildozer/applibs python3'
# Cwd <path>/.buildozer
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting python3
  ERROR: Could not find a version that satisfies the requirement python3 (from versions: none)
ERROR: No matching distribution found for python3
# Command failed: pip install --target=<path>/.buildozer/applibs python3
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
$

Grant

unread,
Jun 20, 2019, 10:28:31 AM6/20/19
to Kivy users support
Reading the buildozer documents it looks for python modules so modified it as follows:

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = kivy

Now getting a little further:

# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for osx
# Check if kivy-sdk-packager exists
# kivy-sdk-packager found at /Users/grpieter/Desktop/Cisco/CLUS19_dcloudapp/.buildozer/osx/platform
# check if Kivy.app exists in local dir
# Kivy.app found at /Users/grpieter/Desktop/Cisco/CLUS19_dcloudapp/.buildozer/osx/platform/kivy-sdk-packager-master/osx
# Install platform
# Check application requirements
# Application requirements already installed, pass
# Check garden requirements
# Remove directory and subdirectory /Users/grpieter/Desktop/Cisco/CLUS19_dcloudapp/.buildozer/libs
# Compile platform
# Build the application #2
<truncated>
# Package the application
# Building package
Traceback (most recent call last):
  File "/Users/grpieter/anaconda/envs/kivyapp/bin/buildozer", line 10, in <module>
    sys.exit(main())
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/__init__.py", line 1044, in run_command
    self.target.run_commands(args)
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/targets/osx.py", line 232, in run_commands
    func(args)
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/targets/osx.py", line 248, in cmd_debug
    self.buildozer.build()
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/__init__.py", line 214, in build
    self.target.build_package()
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/targets/osx.py", line 121, in build_package
    app_deps = open('requirements.txt').read()
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

Grant

unread,
Jun 20, 2019, 10:44:17 AM6/20/19
to Kivy users support
Created a requirements.txt file using the command:

$ pip freeze > requirements.txt

Got a little further:

# Package the application
# Building package
# Create dcloudapp.app

Traceback (most recent call last):
  File "package_app.py", line 45, in <module>
    from docopt import docopt
ModuleNotFoundError: No module named 'docopt'
Traceback (most recent call last):
  File "/Users/grpieter/anaconda/envs/kivyapp/bin/buildozer", line 10, in <module>
    sys.exit(main())
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/__init__.py", line 1044, in run_command
    self.target.run_commands(args)
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/targets/osx.py", line 232, in run_commands
    func(args)
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/targets/osx.py", line 248, in cmd_debug
    self.buildozer.build()
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/__init__.py", line 214, in build
    self.target.build_package()
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/targets/osx.py", line 152, in build_package
    check_output(cmd, cwd=cwd)
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['python', 'package_app.py', '/Users/grpieter/Desktop/Cisco/CLUS19_dcloudapp/.buildozer/osx/app', '--appname=dcloudapp', '--bundlename=Demo Cloud', '--bundleid=cisco.com', '--bundleversion=0.1', '--displayname=Demo Cloud']' returned non-zero exit status 1.

Grant

unread,
Jun 20, 2019, 10:47:38 AM6/20/19
to Kivy users support
Installed module docopt and updated the requirements.txt file.

Now seeing this traceback:

Traceback (most recent call last):
  File "package_app.py", line 233, in <module>
    main(arguments)
  File "package_app.py", line 222, in main
    compile_app(appname)
  File "package_app.py", line 157, in compile_app
    shell=True)
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['dcloudapp.app/Contents/Resources/script -OO -m compileall dcloudapp.app/Contents/Resources/myapp']' returned non-zero exit status 1.

Grant

unread,
Jun 20, 2019, 11:03:05 AM6/20/19
to Kivy users support
Here is the full traceback error:

Traceback (most recent call last):
  File "package_app.py", line 233, in <module>
    main(arguments)
  File "package_app.py", line 222, in main
    compile_app(appname)
  File "package_app.py", line 157, in compile_app
    shell=True)
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['dcloudapp.app/Contents/Resources/script -OO -m compileall dcloudapp.app/Contents/Resources/myapp']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/Users/grpieter/anaconda/envs/kivyapp/bin/buildozer", line 10, in <module>
    sys.exit(main())
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/__init__.py", line 1044, in run_command
    self.target.run_commands(args)
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/targets/osx.py", line 232, in run_commands
    func(args)
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/targets/osx.py", line 248, in cmd_debug
    self.buildozer.build()
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/__init__.py", line 214, in build
    self.target.build_package()
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/site-packages/buildozer/targets/osx.py", line 152, in build_package
    check_output(cmd, cwd=cwd)
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/Users/grpieter/anaconda/envs/kivyapp/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['python', 'package_app.py', '/Users/grpieter/Desktop/Cisco/CLUS19_dcloudapp/.buildozer/osx/app', '--appname=dcloudapp', '--bundlename=Demo Cloud', '--bundleid=cisco.com', '--bundleversion=0.1', '--displayname=Demo Cloud']' returned non-zero exit status 1.

Grant

unread,
Jun 21, 2019, 6:00:44 PM6/21/19
to Kivy users support
I found that the 'package_app.py' is found inside the file osx.py located at:

Users⁩ ▸ ⁨grpieter⁩ ▸ ⁨anaconda⁩ ▸ ⁨envs⁩ ▸ ⁨kivyapp⁩ ▸ ⁨lib⁩ ▸ ⁨python3.6⁩ ▸ ⁨site-packages⁩ ▸ ⁨buildozer⁩ ▸ ⁨targets

I don't find package_app.py anywhere on my system and I am running Python 3.6.0.

Therefore, inside the osx.py file it fails when executing the below command:

cmd = [
            'python', 'package_app.py', self.buildozer.app_dir,
            '--appname={}'.format(package_name),
             '--bundlename={}'.format(title),
             '--bundleid={}'.format(domain),
             '--bundleversion={}'.format(version),
             #'--deps={}'.format(','.join(app_deps)),
             '--displayname={}'.format(title)
             ]
        if icon:
            cmd.append('--icon={}'.format(icon))
        if author:
            cmd.append('--author={}'.format(author))

        check_output(cmd, cwd=cwd)

check_output is a subprocess module.

What is the alternative to 'package_app.py'? Or do I need to install something via PIP???

Thanks,

Grant.

Rick Kreifeldt

unread,
Jun 24, 2019, 4:22:26 PM6/24/19
to Kivy users support
Hi Grant - I went down this path a bit ago myself. I debugged everything as best I could, finding the errors in the various files. I posted it here.

I'm using Python 2.7. So no solace to you but some to me that you are having the same errors with Python3 in the same files as me.

After tumbleweeds floating by for awhile, I went onto Discord and asked. Basically the answer was "None of the core developers work a lot in OSX and probably no one will look at this anytime soon. Especially since you are using Python 2.7 You should be using Pyinstaller". 

My frustration is that they made changes, broke OSX Buildozer, and no one appears to be doing anything about it.

Personally I think that Kivy is seriously missing the boat on really being an easy to use cross-platform system. 

Grant

unread,
Jul 2, 2019, 11:12:41 AM7/2/19
to Kivy users support
I agree Rick,

I have to abandon the idea of using buildozer and now I am looking into PyInstaller.

When people buy a drill they do it not for the drill itself, but because they want a hole.

People use Kivy because they want an application that can run on any device, not because they want widgets.

Will continue the grind....

Prabhat Mohanty

unread,
Jul 2, 2019, 11:30:16 AM7/2/19
to kivy-...@googlegroups.com
Pyinsyaller is giving problem with Pip 19.0 and Python 3.7 while packaging for Windows. Try with Pip 18.1.

--
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 post to this group, send email to kivy-...@googlegroups.com.
Visit this group at https://groups.google.com/group/kivy-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/eca66a93-c234-441b-b11d-69dd4212b569%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages