RE: [kivy-users] Creating an Executable on Mac

137 views
Skip to first unread message

Elliot Garbus

unread,
Apr 3, 2020, 3:58:01 PM4/3/20
to kivy-...@googlegroups.com

Here is my spec file for mac.  This should be a good starting point.  Pay attention to the datas line.  I have highlighted the items you will need to change.

I put my spec file in a subdirectory of my project, and use relative paths.

Note the datas line is tuples that specify (source file, destination directory)

 

 

 

# -*- mode: python -*-

import os

spec_root = os.path.abspath(SPECPATH)
block_cipher = None
app_name = 'ChaseBlissEditor'
mac_icon = '../Images/cb_256.icns'


a = Analysis(['../main.py'],
             pathex=[spec_root],
             binaries=[],
             datas=[('../*.kv', '.'), ('../Images/*.png', './Images')],
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=['_tkinter', 'Tkinter', 'enchant', 'twisted'],
             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)

coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=False,
               name=app_name)

app = BUNDLE(coll,
             name=app_name + '.app',
             icon=mac_icon,
             bundle_identifier=None)

 

 

 

From: Eric B
Sent: Friday, April 3, 2020 11:42 AM
To: Kivy users support
Subject: [kivy-users] Creating an Executable on Mac

 

How do I turn my python file, kivy file and 3 images into an executable file that works on a Mac? Right now I just have a folder with my .py fil, my .kv file and my 3 images that are displayed from my .kv file. I have been trying this for the past 4-5 hours and haven't been able to get it to work. 

--
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/4a8aa578-9635-498a-abf4-1ed947eac375%40googlegroups.com.

 

Eric B

unread,
Apr 3, 2020, 4:39:11 PM4/3/20
to Kivy users support
Thank you very much for your reply. I have highlighted some of the parts that I am confused about but everything is starting to make a lot more sense now, Thanks!

# -*- mode: python ; coding: utf-8 -*-

import os

spec_root = os.path.abspath(SPECPATH).   # I am unsure what the 'SPECPATH' is supposed to be
block_cipher = None
app_name='Form'
mac_icon = '/Users/eric/Desktop/Product/app_icon.icns'

a = Analysis(['main.py'],
             pathex=['spec_root'],
             binaries=[],
             datas=[('../main.kv','.'),('../check.png','.'),('../uncheck.png','.'),('../logo.png','.')],  # I am unsure if I put in the right attributes. I have a product folder that all of these files are in on my  
                                                                                                                                        # desktop. I'm not 100% sure if the "../" part in front of my file names is correct or if the '.' as a destination                                                                                                                                            # directory is correct. 
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=['_tkinter', 'Tkinter', 'enchant', 'twisted'],
             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,
          a.binaries,
          a.zipfiles,
          a.datas,
          [],
          name='main',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          upx_exclude=[],
          runtime_tmpdir=None,
          console=False )

coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=False,
               name=app_name)

app = BUNDLE(exe,

Elliot Garbus

unread,
Apr 3, 2020, 5:02:41 PM4/3/20
to kivy-...@googlegroups.com

SPECPATH is a created by Pyinstaller.  https://pyinstaller.readthedocs.io/en/stable/spec-files.html#globals-available-to-the-spec-file

SPECPATH is the path prefix to the SPEC value as returned by os.path.split().

 

Here is a brief video on relative file paths: https://www.youtube.com/watch?v=ephId3mYu9o

I only watched a few minutes – but it looks like it hits the key points.

 

If your spec file is in the Product directory you do not need the ../

The ../ means go back one directory and the to this destination.

 

‘.’ Refers to the current working directory.

 

If your specfile is in your Product directory you can simply say:

mac_icon = 'app_icon.icns'

 

You also do not need to list every .png file.  You can use *.png

 datas=[('main.kv','.'),('*.png','.')]

 

My project is structured like this:

Project Dir

   Distribution Directory

     Mac.spec – the spec file

   Images

     All my image files

   Main.py – all my code

 

If you look at my original spec file, you can see how this directory structure is used.  Using relative paths and a simlliar file structure each times allows me to reuse most of the spec file.

 

 

 

From: Eric B
Sent: Friday, April 3, 2020 1:39 PM
To: Kivy users support

--

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.

Eric B

unread,
Apr 3, 2020, 5:37:52 PM4/3/20
to Kivy users support
I think I should be ready to make my executable now. This is my current project structure:
Product Dir
    main.py
    main.kv
    app_icon.icns
    check.png
    uncheck.png
    logo.png
    main.spec

My Spec File looks like this:

# -*- mode: python ; coding: utf-8 -*-

import os

spec_root = os.path.abspath(SPECPATH)
block_cipher = None
app_name='Form'
mac_icon = 'app_icon.icns'

a = Analysis(['main.py'],
             pathex=['spec_root'],
             binaries=[],
             datas=[('main.kv','.'),('*.png','.')],

Do you think there is anything I need to change before I turn it into an executable. Also I assume this is the command I should use in terminal when I want to make this into an executable file: 
'pyinstaller main.spec'

Thank you so much for your help btw!

Elliot Garbus

unread,
Apr 3, 2020, 5:42:23 PM4/3/20
to kivy-...@googlegroups.com

Give it a try and see what happens.

>pyinstaller -spec main.spec

 

Or if you don’t want to be asked about deleting a directory,

>pyinstaller -y -spec main.spec

 

Good luck!

 

From: Eric B
Sent: Friday, April 3, 2020 2:37 PM
To: Kivy users support
Subject: Re: [kivy-users] Creating an Executable on Mac

 

I think I should be ready to make my executable now. This is my current project structure:

--

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.

Eric B

unread,
Apr 3, 2020, 5:47:41 PM4/3/20
to Kivy users support
If I go in the dist directory created and open the Form.app, the application shows it trying to open for about half a second and then immediately closes. 

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

Elliot Garbus

unread,
Apr 3, 2020, 5:55:56 PM4/3/20
to kivy-...@googlegroups.com

Look at the kivy log, and see what it contains.  It will provide clues for the next steps.

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/465bf106-4e15-44ed-9ff7-00549becef43%40googlegroups.com.

 

Eric B

unread,
Apr 3, 2020, 5:57:25 PM4/3/20
to Kivy users support
Where can I access the Kivy Log. There is no error that gets displayed automatically for me.

Eric B

unread,
Apr 3, 2020, 6:13:49 PM4/3/20
to Kivy users support
Also, if I right click the Form.app and go to its package contents, there are a folders and a file. One of the folders is called MacOS and has an exec file called main in it. If I run it this it was it outputs and I don't know why.

Erics-MacBook-Air:~ eric$ /Users/eric/Desktop/Product/dist/Form.app/Contents/MacOS/main ; exit;

Traceback (most recent call last):

  File "main.py", line 1, in <module>

ModuleNotFoundError: No module named 'kivy'

[34211] Failed to execute script main

logout

Saving session...

...copying shared history...

...saving history...truncating history files...

...completed.


[Process completed]

Elliot Garbus

unread,
Apr 3, 2020, 6:46:52 PM4/3/20
to kivy-...@googlegroups.com
I’m away from my desk but as I recall,
In finder show hidden file. If you don’t know how, ask google. 
I think it’s your-name/.kivy/logs

Sent from my iPhone

On Apr 3, 2020, at 2:57 PM, Eric B <ericis...@gmail.com> wrote:


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/19f4ce0c-e755-4b4e-b85f-514258ed8a62%40googlegroups.com.

Eric B

unread,
Apr 3, 2020, 6:55:17 PM4/3/20
to Kivy users support
I think I found the log but I don't seem to see the problem that causes it to close?
[INFO   ] Logger: Record log in /Users/eric/.kivy/logs/kivy_20-04-03_20.txt
[INFO   ] Kivy: v1.11.1
[INFO   ] Kivy: Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"
[INFO   ] Python: v3.7.6 (default, Dec 30 2019, 19:38:36) 
[Clang 10.0.0 (clang-1000.11.45.5)]
[INFO   ] Python: Interpreter at "/usr/local/opt/python/bin/python3.7"
[INFO   ] Factory: 184 symbols loaded
[INFO   ] Image: Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] Window: Provider: sdl2
[INFO   ] GL: Using the "OpenGL ES 2" graphics system
[INFO   ] GL: Backend used <sdl2>
[INFO   ] GL: OpenGL version <b'2.1 INTEL-10.36.26'>
[INFO   ] GL: OpenGL vendor <b'Intel Inc.'>
[INFO   ] GL: OpenGL renderer <b'Intel(R) HD Graphics 6000'>
[INFO   ] GL: OpenGL parsed version: 2, 1
[INFO   ] GL: Shading version <b'1.20'>
[INFO   ] GL: Texture max size <16384>
[INFO   ] GL: Texture max units <16>
[INFO   ] Window: auto add sdl2 input provider
[INFO   ] Window: virtual keyboard not allowed, single mode, not docked
[INFO   ] Text: Provider: sdl2
[INFO   ] GL: NPOT texture support is available
[INFO   ] Base: Start application main loop
[INFO   ] WindowSDL: exiting mainloop and closing.
[INFO   ] Base: Leaving application in progress...

Elliot Garbus

unread,
Apr 3, 2020, 7:12:24 PM4/3/20
to kivy-...@googlegroups.com
Yes that is the log. 
Do you have any exception handlers that silently fail?
Something like:
try:
    Some code...
except:
    pass

Sent from my iPad

On Apr 3, 2020, at 3:55 PM, Eric B <ericis...@gmail.com> wrote:


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/4d6687e6-5b44-4089-a58c-4ee70241b41c%40googlegroups.com.

Eric B

unread,
Apr 3, 2020, 7:25:48 PM4/3/20
to Kivy users support
I do but I think this is the problem, I'll show my try, except statements if this isn't relevant.
missing module named 'kivy.uix' - imported by /Users/eric/Desktop/Product/main.py (top-level)
missing module named kivy - imported by /Users/eric/Desktop/Product/main.py (top-level)

I found these in the build folder in the warn-main.txt file

Elliot Garbus

unread,
Apr 3, 2020, 7:31:32 PM4/3/20
to kivy-...@googlegroups.com

I don’t think what you are seeing in the missing module file is relevant.  If you were missing a module you would see an error statement in the log.

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/c9483f74-9f19-432c-9f9a-edcbe3f8b8b1%40googlegroups.com.

 

Eric B

unread,
Apr 3, 2020, 7:36:03 PM4/3/20
to Kivy users support
This is my code then for the main.py file:

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
import smtplib
import datetime


def email_setup(std, gr, rt, res, ct, email_used):
    current_time = ct.strftime("%I^%M %p")
    emailObj = smtplib.SMTP(host='smtp.gmail.com', port=587)
    emailObj.starttls()
    emailObj.login('@gmail.com', 'pass')
    emailObj.sendmail('@gmail.com', '@gmail.com',
                      'Subject: test\n' + std + '#' + gr + '#' + res + '#' + rt + '#' + current_time)
    subject = 'Subject:' + "Early Sign-Out: " + std + '\nStudent Name - ' + std + '\nReason - ' + res + '\nReturn Time - ' + rt
    try:
        emailObj.sendmail('@gmail.com', email_used, subject)
    except TypeError:
        print("Something Went Wrong")

    emailObj.quit()

    #Make email name Reception Desk -> "@gmail.com"


class FormScreen(BoxLayout):
    def pressed(self):
        ct = datetime.datetime.now()
        if self.ids.return_time.text == '':
            rt = "Not Returning"
        else:
            rt = self.ids.return_time.text

        box_list = [self.ids.cb1, self.ids.cb2, self.ids.cb3, self.ids.cb4,
                    self.ids.cb5, self.ids.cb6, self.ids.cb7, self.ids.cb8]
        label_list = [self.ids.l1, self.ids.l2, self.ids.l3, self.ids.l4,
                      self.ids.l5, self.ids.l6, self.ids.l7, self.ids.l8]
        res = 'No Reason'
        i = 0
        while i < 8:
            if box_list[i].active:
                res = label_list[i].text
                box_list[i].active = False
                i += 1
            else:
                i += 1
        try:
            gr = int(self.ids.grade.text)
        except ValueError:
            gr = str(self.ids.grade.text)
        email_used = '@gmail.com'
        if gr == 1:
            email_used = '@gmail.com'
        elif gr == 2:
            email_used = '@gmail.com'
        email_setup(self.ids.student_name.text, self.ids.grade.text, rt, res, ct, email_used)
        self.ids.student_name.text = ''
        self.ids.grade.text = ''
        self.ids.return_time.text = ''


class MainApp(App):
    def build(self):
        return FormScreen()


if __name__ == "__main__":
    MainApp().run()

And this is my main.kv code:
<FormLabel@Label>:
    color: 0.42, 0.1, 0.26, 1
    size: self.texture_size

<RLabel@ButtonBehavior+Label>:
    color: 0.42, 0.1, 0.26, 1
    font_size: self.height*0.8
    text_size:self.size
    size_hint_x: 1

<RCheckBox@CheckBox>:
    size_hint_x: None
    background_radio_normal: 'uncheck.png'
    background_radio_down: 'check.png'

<FormScreen>:
    BoxLayout:
        canvas.before:
            Color:
                rgba: 1,1,1,1
            Rectangle:
                pos: self.pos
                size: self.size

        orientation: 'vertical'
        spacing: root.height/100

        Image:
            source: 'logo.png'
            size_hint: None, None
            height: root.height/15
            width: root.width/5
            pos_hint: {"x":0.05}

        FormLabel:
            bold: True
            text: "Student Sign-Out Form"
            size_hint_y: None
            font_size: root.height/10

        Label:
            size_hint_y: 0.02

        BoxLayout:
            orientation: 'horizontal'
            size_hint_y: 0.3
            FormLabel:
                text: "Student Name:"
                font_size: root.height/15
                size_hint: None, 1
                padding_x: root.width/30
            TextInput:
                multiline: False
                font_size: self.height*0.6
                size_hint: None, 1
                width: root.width*0.55
                id: student_name

        Label:
            size_hint_y: 0.02

        BoxLayout:
            orientation: 'horizontal'
            size_hint_y: 0.3
            Label:
                size_hint_x: None
                width: root.width*0.05
            FormLabel:
                text: "Grade:"
                font_size: root.height/15
                size_hint: None, 1
                padding_x: root.width/30
            TextInput:
                multiline: False
                font_size: self.height*0.6
                size_hint: None, 1
                width: root.width*0.15
                id: grade
            FormLabel:
                text: "Return Time:"
                font_size: root.height/15
                size_hint: None, 1
                padding_x: root.width/30
            TextInput:
                multiline: False
                font_size: self.height*0.6
                size_hint: None, 1
                width: root.width*0.16
                id: return_time
                hint_text: '00:00/No'

        FormLabel:
            size_hint: None, 0.3
            text: "Select a Reason:"
            font_size: root.height/15
            padding_x: root.width/30

        GridLayout:
            cols: 2
            size_hint_x: 0.8
            pos_hint: {"center_x":0.5}
            GridLayout:
                cols: 2
                RCheckBox:
                    id: cb1
                    group: 'rBox'
                RLabel:
                    on_press: cb1._do_press()
                    id: l1
                    text: 'Appointment'
                    width: root.width*0.5
            GridLayout:
                cols: 2
                RCheckBox:
                    id: cb2
                    group: 'rBox'
                RLabel:
                    on_press: cb2._do_press()
                    id: l2
                    text: 'Illness'
                    width: root.width*0.5
            GridLayout:
                cols: 2
                RCheckBox:
                    id: cb3
                    group: 'rBox'
                RLabel:
                    on_press: cb3._do_press()
                    id: l3
                    text: 'Vacation'
                    width: root.width*0.5
            GridLayout:
                cols: 2
                RCheckBox:
                    id: cb4
                    group: 'rBox'
                RLabel:
                    on_press: cb4._do_press()
                    id: l4
                    text: 'Injury'
                    width: root.width*0.5
            GridLayout:
                cols: 2
                RCheckBox:
                    id: cb5
                    group: 'rBox'
                RLabel:
                    on_press: cb5._do_press()
                    id: l5
                    text: 'Personal'
                    width: root.width*0.5
            GridLayout:
                cols: 2
                RCheckBox:
                    id: cb6
                    group: 'rBox'
                RLabel:
                    on_press: cb6._do_press()
                    id: l6
                    text: 'Athletics'
                    width: root.width*0.5
            GridLayout:
                cols: 2
                RCheckBox:
                    id: cb7
                    group: 'rBox'
                RLabel:
                    on_press: cb7._do_press()
                    id: l7
                    text: 'Home'
                    width: root.width*0.5
            GridLayout:
                cols: 2
                RCheckBox:
                    id: cb8
                    group: 'rBox'
                RLabel:
                    on_press: cb8._do_press()
                    id: l8
                    text: 'Other'
                    width: root.width*0.5

        FloatLayout:
            Button:
                background_normal: ''
                background_color: 0.9,0.9,0.9,1
                size_hint: None, None
                height: root.height*0.15
                width: root.width*0.2
                pos_hint: {"x": 0.5-(self.width/root.width)*0.5}
                font_size: root.height/15
                color: 0.42, 0.1, 0.26, 1
                text: "Submit"
                on_release: root.pressed()

Eric B

unread,
Apr 3, 2020, 7:48:46 PM4/3/20
to Kivy users support
Also those error messages came with this message at the top of the file:
This file lists modules PyInstaller was not able to find. This does not
necessarily mean this module is required for running you program. Python and
Python 3rd-party packages include a lot of conditional or optional modules. For
example the module 'ntpath' only exists on Windows, whereas the module
'posixpath' only exists on Posix systems.

and then these were the missing modules:
missing module named 'kivy.uix' - imported by /Users/eric/Desktop/Product/main.py (top-level)
missing module named kivy - imported by /Users/eric/Desktop/Product/main.py (top-level)

Elliot Garbus

unread,
Apr 3, 2020, 8:39:41 PM4/3/20
to kivy-...@googlegroups.com

A few things to try:

Add

import kivy

to the top of main.

 

Check the files in the created dist directory, are the kv file and png files where you would expect them to be?  Especially the kv file.

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/987a9cb6-4c48-43c0-aceb-a8c9c10cef68%40googlegroups.com.

 

Eric B

unread,
Apr 4, 2020, 12:11:44 AM4/4/20
to Kivy users support
I added the import kivy to the top of the main.py file and tried making the executable again, this is what the terminal spits out when its creating everything, maybe something in here is off:

260 INFO: PyInstaller: 3.6

261 INFO: Python: 3.8.1

273 INFO: Platform: macOS-10.13.6-x86_64-i386-64bit

276 INFO: UPX is not available.

278 INFO: Extending PYTHONPATH with paths

['/Users/eric/Desktop/Product', '/Users/eric/Desktop/Product/spec_root']

278 INFO: checking Analysis

278 INFO: Building Analysis because Analysis-00.toc is non existent

278 INFO: Initializing module dependency graph...

282 INFO: Caching module graph hooks...

294 INFO: Analyzing base_library.zip ...

4233 INFO: Processing pre-find module path hook   distutils

4235 INFO: distutils: retargeting to non-venv dir '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8'

7038 INFO: Caching module dependency graph...

7165 INFO: running Analysis Analysis-00.toc

7179 INFO: Analyzing main.py

7184 INFO: Processing module hooks...

7185 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...

7187 INFO: Loading module hook "hook-lib2to3.py"...

7196 INFO: Loading module hook "hook-encodings.py"...

7276 INFO: Loading module hook "hook-sysconfig.py"...

7292 INFO: Loading module hook "hook-xml.py"...

7354 INFO: Loading module hook "hook-pydoc.py"...

7356 INFO: Loading module hook "hook-distutils.py"...

7377 INFO: Looking for ctypes DLLs

7413 INFO: Analyzing run-time hooks ...

7417 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'

7428 INFO: Looking for dynamic libraries

7685 INFO: Looking for eggs

7685 INFO: Using Python library /Library/Frameworks/Python.framework/Versions/3.8/Python

7693 INFO: Warnings written to /Users/eric/Desktop/Product/build/main/warn-main.txt

7742 INFO: Graph cross-reference written to /Users/eric/Desktop/Product/build/main/xref-main.html

7754 INFO: Appending 'datas' from .spec

7757 INFO: checking PYZ

7757 INFO: Building PYZ because PYZ-00.toc is non existent

7757 INFO: Building PYZ (ZlibArchive) /Users/eric/Desktop/Product/build/main/PYZ-00.pyz

8280 INFO: Building PYZ (ZlibArchive) /Users/eric/Desktop/Product/build/main/PYZ-00.pyz completed successfully.

8290 INFO: checking PKG

8290 INFO: Building PKG because PKG-00.toc is non existent

8290 INFO: Building PKG (CArchive) PKG-00.pkg

11769 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.

11774 INFO: Bootloader /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PyInstaller/bootloader/Darwin-64bit/runw

11774 INFO: checking EXE

11775 INFO: Building EXE because EXE-00.toc is non existent

11775 INFO: Building EXE from EXE-00.toc

11775 INFO: Appending archive to EXE /Users/eric/Desktop/Product/dist/main

11788 INFO: Fixing EXE for code signing /Users/eric/Desktop/Product/dist/main

11795 INFO: Building EXE from EXE-00.toc completed successfully.

11798 INFO: checking COLLECT

11798 INFO: Building COLLECT because COLLECT-00.toc is non existent

11799 INFO: Building COLLECT COLLECT-00.toc

12732 INFO: Building COLLECT COLLECT-00.toc completed successfully.

12739 INFO: checking BUNDLE

12739 INFO: Building BUNDLE because BUNDLE-00.toc is non existent

12739 INFO: Building BUNDLE BUNDLE-00.toc

12752 INFO: moving BUNDLE data files to Resource directory


It also still says that the module kivy cannot be found if I execute the program on the right (attached a picture with a green circle in it to clarify which file gave the result):



/Users/eric/Desktop/Product/dist/main ; exit;

Erics-MacBook-Air:~ eric$ /Users/eric/Desktop/Product/dist/main ; exit;

Traceback (most recent call last):

  File "main.py", line 1, in <module>

ModuleNotFoundError: No module named 'kivy'

[37160] Failed to execute script main

logout

Saving session...

...copying shared history...

...saving history...truncating history files...

...completed.


Finally, I'm not really sure where the kv file along with the pictures are supposed to be, see attached photo for where they are. In the photo you can see they are in the dist/Form folder

Screen Shot 2020-04-04 at 12.04.48 AM.png
Screen Shot 2020-04-04 at 12.10.34 AM.png

Elliot Garbus

unread,
Apr 4, 2020, 1:13:53 AM4/4/20
to kivy-...@googlegroups.com

I think this is the problem:

261 INFO: Python: 3.8.1

The default kivy installation does not run on Python 3.8

Your early log was showing it running on 3.7

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/1ffafe1a-dd2f-4631-9697-a9495c045885%40googlegroups.com.

 

Moqing Yu

unread,
Apr 4, 2020, 2:45:11 AM4/4/20
to kivy-...@googlegroups.com
pyinstaller can pack the py to a executable file on MAC OS, please check the pyinstaller docs and kivy docs for detail.

Eric B <ericis...@gmail.com> 于 2020年4月4日周六 上午2:42写道:
How do I turn my python file, kivy file and 3 images into an executable file that works on a Mac? Right now I just have a folder with my .py fil, my .kv file and my 3 images that are displayed from my .kv file. I have been trying this for the past 4-5 hours and haven't been able to get it to work. 

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

Eric B

unread,
Apr 4, 2020, 8:30:08 AM4/4/20
to Kivy users support
Yes, you are right I think. I checked my program in pycharm to see what version of python I was using when I made it and I was using version 3.7
Do you know how I can fix this  to use python 3.7 when I make the executable?

Eric B

unread,
Apr 4, 2020, 9:11:23 AM4/4/20
to Kivy users support
I was just able to make an executable using the version of python I used in pycharm (3.7.4). But when I open the app it shows a black screen as if it doesn't register the main.kv file. Any idea how to fix this?

Elliot Garbus

unread,
Apr 4, 2020, 9:52:55 AM4/4/20
to kivy-...@googlegroups.com

Progress!

 

Check that your main.kv file is in the same directory under dist as your main.py file.

Check that main.kv is spelled correctly in your spec file ( or change it to *.kv)

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/b0de0217-53c0-4fb8-8e5b-d35e91e50285%40googlegroups.com.

 

Eric B

unread,
Apr 4, 2020, 10:01:35 AM4/4/20
to Kivy users support
I changed the main.kv to *.kv in my spec file and it didn't change anything when I made an executable again. When I made the executable this is what the consle spit out while making it:

Erics-MacBook-Air:Product eric$ pyinstaller -spec main.spec

92 INFO: PyInstaller: 3.6

92 INFO: Python: 3.7.4

105 INFO: Platform: Darwin-17.7.0-x86_64-i386-64bit

109 INFO: UPX is not available.

110 INFO: Extending PYTHONPATH with paths

['/Users/eric/Desktop/Product', '/Users/eric/Desktop/Product/spec_root']

111 INFO: checking Analysis

111 INFO: Building Analysis because Analysis-00.toc is non existent

111 INFO: Initializing module dependency graph...

113 INFO: Caching module graph hooks...

125 INFO: Analyzing base_library.zip ...

3741 INFO: Caching module dependency graph...

3845 INFO: running Analysis Analysis-00.toc

3863 INFO: Analyzing main.py

4878 INFO: Processing pre-find module path hook   distutils

4880 INFO: distutils: retargeting to non-venv dir '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7'

6330 INFO: Processing module hooks...

6331 INFO: Loading module hook "hook-encodings.py"...

6402 INFO: Loading module hook "hook-kivy.py"...

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_9.txt

6418 INFO: [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_9.txt

[INFO   ] [Kivy        ] v1.11.1

6417 INFO: [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

6418 INFO: [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

6418 INFO: [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

6419 INFO: [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

[INFO   ] [Factory     ] 184 symbols loaded

6430 INFO: [Factory     ] 184 symbols loaded

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_10.txt

[INFO   ] [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_11.txt

[INFO   ] [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

[INFO   ] [Audio       ] Providers: audio_sdl2 (audio_ffpyplayer, audio_avplayer ignored)

[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)

[INFO   ] [Camera      ] Provider: avfoundation

[INFO   ] [Clipboard   ] Provider: sdl2(['clipboard_nspaste'] ignored)

[INFO   ] [Factory     ] 184 symbols loaded

[INFO   ] [Window      ] Provider: sdl2

[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system

[INFO   ] [GL          ] Backend used <sdl2>

[INFO   ] [GL          ] OpenGL version <b'2.1 INTEL-10.36.26'>

[INFO   ] [GL          ] OpenGL vendor <b'Intel Inc.'>

[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 6000'>

[INFO   ] [GL          ] OpenGL parsed version: 2, 1

[INFO   ] [GL          ] Shading version <b'1.20'>

[INFO   ] [GL          ] Texture max size <16384>

[INFO   ] [GL          ] Texture max units <16>

[INFO   ] [Window      ] auto add sdl2 input provider

[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked

[CRITICAL] [Spelling    ] Unable to find any valuable Spelling provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes

enchant - ModuleNotFoundError: No module named 'enchant'

  File "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/__init__.py", line 63, in core_select_lib

    fromlist=[modulename], level=0)

  File "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/spelling/spelling_enchant.py", line 12, in <module>

    import enchant


osxappkit - ModuleNotFoundError: No module named 'AppKit'

  File "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/__init__.py", line 63, in core_select_lib

    fromlist=[modulename], level=0)

  File "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/spelling/spelling_osxappkit.py", line 16, in <module>

    from AppKit import NSSpellChecker, NSMakeRange


[INFO   ] [Text        ] Provider: sdl2

[INFO   ] [Video       ] Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)

10158 INFO: Excluding import 'twisted'

10163 INFO:   Removing import of twisted from module kivy.support

10164 INFO: Import to be excluded not found: 'tkinter'

10164 INFO: Excluding import '_tkinter'

10170 INFO: Loading module hook "hook-xml.dom.domreg.py"...

10171 INFO: Loading module hook "hook-docutils.py"...

11769 INFO: Loading module hook "hook-sysconfig.py"...

11781 INFO: Loading module hook "hook-xml.py"...

11783 INFO: Loading module hook "hook-pydoc.py"...

11785 INFO: Loading module hook "hook-distutils.py"...

11788 INFO: Loading module hook "hook-pygments.py"...

13716 INFO: Loading module hook "hook-pkg_resources.py"...

14055 INFO: Processing pre-safe import module hook   win32com

14260 INFO: Excluding import '__main__'

14262 INFO:   Removing import of __main__ from module pkg_resources

14263 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...

14313 INFO: Looking for ctypes DLLs

14340 WARNING: library libmtdev.so.1 required via ctypes not found

14363 INFO: Analyzing run-time hooks ...

14371 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'

14375 INFO: Including run-time hook 'pyi_rth_kivy.py'

14376 INFO: Including run-time hook 'pyi_rth_gstreamer.py'

14378 INFO: Including run-time hook 'pyi_rth_pkgres.py'

14397 INFO: Looking for dynamic libraries

14605 ERROR: Can not find path @executable_path/../../.dylibs/GStreamer (needed by /Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/lib/gstplayer/_gstplayer.cpython-37m-darwin.so)

14664 ERROR: Can not find path @executable_path/webp (needed by /Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/image/../../.dylibs/SDL2_image)

14679 ERROR: Can not find path ./OpusFile.framework/Versions/A/OpusFile (needed by /Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/image/../../.dylibs/SDL2_mixer)

14706 INFO: Looking for eggs

14706 INFO: Using Python library /Library/Frameworks/Python.framework/Versions/3.7/Python

14717 INFO: Warnings written to /Users/eric/Desktop/Product/build/main/warn-main.txt

14804 INFO: Graph cross-reference written to /Users/eric/Desktop/Product/build/main/xref-main.html

14844 INFO: Appending 'datas' from .spec

14860 INFO: checking PYZ

14861 INFO: Building PYZ because PYZ-00.toc is non existent

14861 INFO: Building PYZ (ZlibArchive) /Users/eric/Desktop/Product/build/main/PYZ-00.pyz

16032 INFO: Building PYZ (ZlibArchive) /Users/eric/Desktop/Product/build/main/PYZ-00.pyz completed successfully.

16067 INFO: checking PKG

16067 INFO: Building PKG because PKG-00.toc is non existent

16067 INFO: Building PKG (CArchive) PKG-00.pkg

22388 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.

22401 INFO: Bootloader /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/bootloader/Darwin-64bit/runw

22401 INFO: checking EXE

22401 INFO: Building EXE because EXE-00.toc is non existent

22401 INFO: Building EXE from EXE-00.toc

22401 INFO: Appending archive to EXE /Users/eric/Desktop/Product/dist/main

22428 INFO: Fixing EXE for code signing /Users/eric/Desktop/Product/dist/main

22434 INFO: Building EXE from EXE-00.toc completed successfully.

22445 INFO: checking COLLECT

22445 INFO: Building COLLECT because COLLECT-00.toc is non existent

22446 INFO: Building COLLECT COLLECT-00.toc

24432 INFO: Building COLLECT COLLECT-00.toc completed successfully.

24443 INFO: checking BUNDLE

24444 INFO: Building BUNDLE because BUNDLE-00.toc is non existent

24444 INFO: Building BUNDLE BUNDLE-00.toc

24497 INFO: moving BUNDLE data files to Resource directory

Erics-MacBook-Air:Product eric$ 

Elliot Garbus

unread,
Apr 4, 2020, 10:13:48 AM4/4/20
to kivy-...@googlegroups.com

Is your main.kv file is in the same directory under dist as your main.py file?

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/8d9ae85f-e2db-4504-8abb-03c244220f99%40googlegroups.com.

 

Eric B

unread,
Apr 4, 2020, 10:35:41 AM4/4/20
to Kivy users support
It is not, in the dist file theres 3 files, a Form Folder, the Form.app file, and a black exec file called main. In the Form folder is has a bunch of exec files and then the 3 images I use in my code and only the main.kv file. Theres no main.py file in there

Eric B

unread,
Apr 4, 2020, 10:39:06 AM4/4/20
to Kivy users support
I was looking through the Form folder and in it there was a main exec file and I opened it and it worked, the program worked as it was supposed to. See attached picture.

[INFO<span style="font-size:8.5pt;font-family:"Menlo",

Screen Shot 2020-04-04 at 10.38.02 AM.png

Elliot Garbus

unread,
Apr 4, 2020, 10:42:57 AM4/4/20
to kivy-...@googlegroups.com

Is there a form.app?

--

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/8ba61405-2e88-471e-8f5a-669cdfef88b0%40googlegroups.com.

 

Screen Shot 2020-04-04 at 10.38.02 AM.png

Eric B

unread,
Apr 4, 2020, 10:47:19 AM4/4/20
to Kivy users support
Yes but when I open it, it shows a black screen. see attached photo.

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

Screen Shot 2020-04-04 at 10.47.02 AM.png

Elliot Garbus

unread,
Apr 4, 2020, 10:57:14 AM4/4/20
to kivy-...@googlegroups.com

Delete the build and dist directories, and try building the app again. 

If that doesn’t work, repost your spec file.

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/eac45ba2-cf7a-4c7e-ac7a-480cc3d13d48%40googlegroups.com.

 

Eric B

unread,
Apr 4, 2020, 11:06:13 AM4/4/20
to Kivy users support
It didn't fix it so heres my spec file:

# -*- mode: python ; coding: utf-8 -*-

import os

spec_root = os.path.abspath(SPECPATH)
block_cipher = None
app_name='Form'
mac_icon = 'app_icon.icns'

a = Analysis(['main.py'],
             pathex=['spec_root'],
             binaries=[],
             datas=[('*.kv','.'),('*.png','.')],
Also heres the logs from opening the nonworking main exec:

Last login: Sat Apr  4 11:04:07 on ttys000

/Users/eric/Desktop/dist/main ; exit;

Erics-MacBook-Air:~ eric$ /Users/eric/Desktop/dist/main ; exit;

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_35.txt

[INFO   ] [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/var/folders/4s/nk6w74292_12k7jf2rs1qs9r0000gn/T/_MEIcRO474/kivy/__init__.pyc"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Users/eric/Desktop/dist/main"

[INFO   ] [Factory     ] 184 symbols loaded

[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)

[INFO   ] [Window      ] Provider: sdl2

[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system

[INFO   ] [GL          ] Backend used <sdl2>

[INFO   ] [GL          ] OpenGL version <b'2.1 INTEL-10.36.26'>

[INFO   ] [GL          ] OpenGL vendor <b'Intel Inc.'>

[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 6000'>

[INFO   ] [GL          ] OpenGL parsed version: 2, 1

[INFO   ] [GL          ] Shading version <b'1.20'>

[INFO   ] [GL          ] Texture max size <16384>

[INFO   ] [GL          ] Texture max units <16>

[INFO   ] [Window      ] auto add sdl2 input provider

[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked

[INFO   ] [Base        ] Start application main loop



 and the working one in the Form dir:

Last login: Sat Apr  4 11:05:40 on ttys000

Erics-MacBook-Air:~ eric$ /Users/eric/Desktop/dist/Form/main ; exit;

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_36.txt

[INFO   ] [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/var/folders/4s/nk6w74292_12k7jf2rs1qs9r0000gn/T/_MEIZYweRm/kivy/__init__.pyc"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Users/eric/Desktop/dist/Form/main"

[INFO   ] [Factory     ] 184 symbols loaded

[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)

[INFO   ] [Window      ] Provider: sdl2

[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system

[INFO   ] [GL          ] Backend used <sdl2>

[INFO   ] [GL          ] OpenGL version <b'2.1 INTEL-10.36.26'>

[INFO   ] [GL          ] OpenGL vendor <b'Intel Inc.'>

[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 6000'>

[INFO   ] [GL          ] OpenGL parsed version: 2, 1

[INFO   ] [GL          ] Shading version <b'1.20'>

[INFO   ] [GL          ] Texture max size <16384>

[INFO   ] [GL          ] Texture max units <16>

[INFO   ] [Window      ] auto add sdl2 input provider

[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked

[INFO   ] [Text        ] Provider: sdl2

[INFO   ] [GL          ] NPOT texture support is available

[INFO   ] [Base        ] Start application main loop


Elliot Garbus

unread,
Apr 4, 2020, 11:23:34 AM4/4/20
to kivy-...@googlegroups.com

Is 'app_icon.icns'  a valid mac icon file?  How was it created?  Can you view it?

 

Error: pathex=['spec_root'],

Should be: pathex=[spec_root],

 

Change exe to:

exe = EXE(pyz,
          a.scripts,
          [],
         
exclude_binaries=True,
         
name=app_name,
         
debug=False,
         
bootloader_ignore_signals=False,
         
strip=False,
         
upx=False,
         
console=False)

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/409c44d2-77fc-459c-ae29-75ff610ad462%40googlegroups.com.

 

Eric B

unread,
Apr 4, 2020, 11:37:39 AM4/4/20
to Kivy users support
When I did these changes, now the Form.app wouldn't open, but the app_name file opened in the dist/Form directory.
My Spec File:
# -*- mode: python ; coding: utf-8 -*-

import os

spec_root = os.path.abspath(SPECPATH)
block_cipher = None
app_name='Form'
mac_icon = 'app_icon.icns'

a = Analysis(['main.py'],
             pathex=[spec_root],
             binaries=[],
             datas=[('*.kv','.'),('*.png','.')],
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=['_tkinter', 'Tkinter', 'enchant', 'twisted'],
             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 )

coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=False,
               name=app_name)

app = BUNDLE(exe,
             name=app_name + '.app',
             icon=mac_icon,
             bundle_identifier=None)

This is what the console outputted when making the executable, I highlighted places that I think are areas of interest:

Erics-MacBook-Air:Product eric$ pyinstaller -spec main.spec

56 INFO: PyInstaller: 3.6

56 INFO: Python: 3.7.4

62 INFO: Platform: Darwin-17.7.0-x86_64-i386-64bit

65 INFO: UPX is not available.

67 INFO: Extending PYTHONPATH with paths

['/Users/eric/Desktop/Product', '/Users/eric/Desktop/Product']

67 INFO: checking Analysis

68 INFO: Building Analysis because Analysis-00.toc is non existent

68 INFO: Initializing module dependency graph...

70 INFO: Caching module graph hooks...

75 INFO: Analyzing base_library.zip ...

3250 INFO: Caching module dependency graph...

3353 INFO: running Analysis Analysis-00.toc

3360 INFO: Analyzing main.py

4172 INFO: Processing pre-find module path hook   distutils

4173 INFO: distutils: retargeting to non-venv dir '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7'

5323 INFO: Processing module hooks...

5323 INFO: Loading module hook "hook-encodings.py"...

5390 INFO: Loading module hook "hook-kivy.py"...

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_37.txt

5405 INFO: [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_37.txt

[INFO   ] [Kivy        ] v1.11.1

5404 INFO: [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

5405 INFO: [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

5405 INFO: [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

5405 INFO: [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

[INFO   ] [Factory     ] 184 symbols loaded

5408 INFO: [Factory     ] 184 symbols loaded

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_38.txt

[INFO   ] [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_39.txt

[INFO   ] [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

[INFO   ] [Audio       ] Providers: audio_sdl2 (audio_ffpyplayer, audio_avplayer ignored)

[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)

[INFO   ] [Camera      ] Provider: avfoundation

[INFO   ] [Clipboard   ] Provider: sdl2(['clipboard_nspaste'] ignored)

[INFO   ] [Factory     ] 184 symbols loaded

[INFO   ] [Window      ] Provider: sdl2

[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system

[INFO   ] [GL          ] Backend used <sdl2>

[INFO   ] [GL          ] OpenGL version <b'2.1 INTEL-10.36.26'>

[INFO   ] [GL          ] OpenGL vendor <b'Intel Inc.'>

[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 6000'>

[INFO   ] [GL          ] OpenGL parsed version: 2, 1

[INFO   ] [GL          ] Shading version <b'1.20'>

[INFO   ] [GL          ] Texture max size <16384>

[INFO   ] [GL          ] Texture max units <16>

[INFO   ] [Window      ] auto add sdl2 input provider

[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked

[CRITICAL] [Spelling    ] Unable to find any valuable Spelling provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes

enchant - ModuleNotFoundError: No module named 'enchant'

  File "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/__init__.py", line 63, in core_select_lib

    fromlist=[modulename], level=0)

  File "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/spelling/spelling_enchant.py", line 12, in <module>

    import enchant


osxappkit - ModuleNotFoundError: No module named 'AppKit'

  File "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/__init__.py", line 63, in core_select_lib

    fromlist=[modulename], level=0)

  File "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/spelling/spelling_osxappkit.py", line 16, in <module>

    from AppKit import NSSpellChecker, NSMakeRange


[INFO   ] [Text        ] Provider: sdl2

[INFO   ] [Video       ] Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)

8395 INFO: Excluding import 'twisted'

8400 INFO:   Removing import of twisted from module kivy.support

8401 INFO: Excluding import '_tkinter'

8407 INFO: Import to be excluded not found: 'tkinter'

8407 INFO: Loading module hook "hook-xml.dom.domreg.py"...

8407 INFO: Loading module hook "hook-docutils.py"...

9746 INFO: Loading module hook "hook-sysconfig.py"...

9754 INFO: Loading module hook "hook-xml.py"...

9755 INFO: Loading module hook "hook-pydoc.py"...

9755 INFO: Loading module hook "hook-distutils.py"...

9756 INFO: Loading module hook "hook-pygments.py"...

11208 INFO: Loading module hook "hook-pkg_resources.py"...

11624 INFO: Processing pre-safe import module hook   win32com

11663 INFO: Excluding import '__main__'

11665 INFO:   Removing import of __main__ from module pkg_resources

11665 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...

11710 INFO: Looking for ctypes DLLs

11736 WARNING: library libmtdev.so.1 required via ctypes not found

11755 INFO: Analyzing run-time hooks ...

11763 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'

11770 INFO: Including run-time hook 'pyi_rth_kivy.py'

11772 INFO: Including run-time hook 'pyi_rth_pkgres.py'

11773 INFO: Including run-time hook 'pyi_rth_gstreamer.py'

11802 INFO: Looking for dynamic libraries

11971 ERROR: Can not find path @executable_path/../../.dylibs/GStreamer (needed by /Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/lib/gstplayer/_gstplayer.cpython-37m-darwin.so)

12032 ERROR: Can not find path @executable_path/webp (needed by /Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/image/../../.dylibs/SDL2_image)

12035 ERROR: Can not find path ./OpusFile.framework/Versions/A/OpusFile (needed by /Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/core/image/../../.dylibs/SDL2_mixer)

12062 INFO: Looking for eggs

12062 INFO: Using Python library /Library/Frameworks/Python.framework/Versions/3.7/Python

12073 INFO: Warnings written to /Users/eric/Desktop/Product/build/main/warn-main.txt

12157 INFO: Graph cross-reference written to /Users/eric/Desktop/Product/build/main/xref-main.html

12194 INFO: Appending 'datas' from .spec

12209 INFO: checking PYZ

12209 INFO: Building PYZ because PYZ-00.toc is non existent

12209 INFO: Building PYZ (ZlibArchive) /Users/eric/Desktop/Product/build/main/PYZ-00.pyz

13296 INFO: Building PYZ (ZlibArchive) /Users/eric/Desktop/Product/build/main/PYZ-00.pyz completed successfully.

13325 INFO: checking PKG

13325 INFO: Building PKG because PKG-00.toc is non existent

13325 INFO: Building PKG (CArchive) PKG-00.pkg

13347 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.

13349 INFO: Bootloader /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/bootloader/Darwin-64bit/runw

13349 INFO: checking EXE

13349 INFO: Building EXE because EXE-00.toc is non existent

13349 INFO: Building EXE from EXE-00.toc

13349 INFO: Appending archive to EXE /Users/eric/Desktop/Product/build/main/app_name

13355 INFO: Fixing EXE for code signing /Users/eric/Desktop/Product/build/main/app_name

13359 INFO: Building EXE from EXE-00.toc completed successfully.

13360 INFO: checking COLLECT

13360 INFO: Building COLLECT because COLLECT-00.toc is non existent

13360 INFO: Building COLLECT COLLECT-00.toc

15296 INFO: Building COLLECT COLLECT-00.toc completed successfully.

15316 INFO: checking BUNDLE

15316 INFO: Building BUNDLE because BUNDLE-00.toc is non existent

15316 INFO: Building BUNDLE BUNDLE-00.toc

15331 INFO: moving BUNDLE data files to Resource directory



Elliot Garbus

unread,
Apr 4, 2020, 11:45:42 AM4/4/20
to kivy-...@googlegroups.com

name='app_name', should be name = app_name,

No quotes.

 

just copy and paste.  No changes.

 

From: Eric B
Sent: Saturday, April 4, 2020 8:37 AM
To: Kivy users support
Subject: Re: [kivy-users] Creating an Executable on Mac

 

When I did these changes, now the Form.app wouldn't open, but the app_name file opened in the dist/Form directory.

--

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.

Message has been deleted

Eric B

unread,
Apr 4, 2020, 12:01:54 PM4/4/20
to Kivy users support
When I try it like how you suggested I got this from the console, see the highlighted part:

Last login: Sat Apr  4 11:53:47 on ttys000

Erics-MacBook-Air:~ eric$ cd Desktop/Product/

Erics-MacBook-Air:Product eric$ pyinstaller -spec main.spec

57 INFO: PyInstaller: 3.6

57 INFO: Python: 3.7.4

63 INFO: Platform: Darwin-17.7.0-x86_64-i386-64bit

67 INFO: UPX is not available.

69 INFO: Extending PYTHONPATH with paths

['/Users/eric/Desktop/Product', '/Users/eric/Desktop/Product']

69 INFO: checking Analysis

69 INFO: Building Analysis because Analysis-00.toc is non existent

69 INFO: Initializing module dependency graph...

71 INFO: Caching module graph hooks...

76 INFO: Analyzing base_library.zip ...

3275 INFO: Caching module dependency graph...

3380 INFO: running Analysis Analysis-00.toc

3388 INFO: Analyzing main.py

4191 INFO: Processing pre-find module path hook   distutils

4192 INFO: distutils: retargeting to non-venv dir '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7'

5347 INFO: Processing module hooks...

5347 INFO: Loading module hook "hook-encodings.py"...

5414 INFO: Loading module hook "hook-kivy.py"...

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_55.txt

5429 INFO: [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_55.txt

[INFO   ] [Kivy        ] v1.11.1

5428 INFO: [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

5429 INFO: [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

5430 INFO: [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

5430 INFO: [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

[INFO   ] [Factory     ] 184 symbols loaded

5432 INFO: [Factory     ] 184 symbols loaded

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_56.txt

[INFO   ] [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/__init__.py"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"

[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)

[INFO   ] [Logger      ] Record log in /Users/eric/.kivy/logs/kivy_20-04-04_57.txt

8442 INFO: Excluding import 'twisted'

8446 INFO:   Removing import of twisted from module kivy.support

8447 INFO: Import to be excluded not found: 'tkinter'

8447 INFO: Excluding import '_tkinter'

8453 INFO: Loading module hook "hook-xml.dom.domreg.py"...

8454 INFO: Loading module hook "hook-docutils.py"...

9854 INFO: Loading module hook "hook-sysconfig.py"...

9862 INFO: Loading module hook "hook-xml.py"...

9863 INFO: Loading module hook "hook-pydoc.py"...

9863 INFO: Loading module hook "hook-distutils.py"...

9864 INFO: Loading module hook "hook-pygments.py"...

11319 INFO: Loading module hook "hook-pkg_resources.py"...

11559 INFO: Processing pre-safe import module hook   win32com

11778 INFO: Excluding import '__main__'

11779 INFO:   Removing import of __main__ from module pkg_resources

11780 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...

11829 INFO: Looking for ctypes DLLs

11856 WARNING: library libmtdev.so.1 required via ctypes not found

11874 INFO: Analyzing run-time hooks ...

11882 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'

11886 INFO: Including run-time hook 'pyi_rth_kivy.py'

11887 INFO: Including run-time hook 'pyi_rth_pkgres.py'

11888 INFO: Including run-time hook 'pyi_rth_gstreamer.py'

11904 INFO: Looking for dynamic libraries

12085 ERROR: Can not find path @executable_path/../../.dylibs/GStreamer (needed by /Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/lib/gstplayer/_gstplayer.cpython-37m-darwin.so)

12132 ERROR: Can not find path @executable_path/webp (needed by /Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/graphics/cgl_backend/../../.dylibs/SDL2_image)

12135 ERROR: Can not find path ./OpusFile.framework/Versions/A/OpusFile (needed by /Users/eric/Library/Python/3.7/lib/python/site-packages/kivy/graphics/cgl_backend/../../.dylibs/SDL2_mixer)

12162 INFO: Looking for eggs

12163 INFO: Using Python library /Library/Frameworks/Python.framework/Versions/3.7/Python

12172 INFO: Warnings written to /Users/eric/Desktop/Product/build/main/warn-main.txt

12252 INFO: Graph cross-reference written to /Users/eric/Desktop/Product/build/main/xref-main.html

12290 INFO: Appending 'datas' from .spec

12305 INFO: checking PYZ

12305 INFO: Building PYZ because PYZ-00.toc is non existent

12305 INFO: Building PYZ (ZlibArchive) /Users/eric/Desktop/Product/build/main/PYZ-00.pyz

13405 INFO: Building PYZ (ZlibArchive) /Users/eric/Desktop/Product/build/main/PYZ-00.pyz completed successfully.

13435 INFO: checking PKG

13435 INFO: Building PKG because PKG-00.toc is non existent

13435 INFO: Building PKG (CArchive) PKG-00.pkg

13455 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.

13457 INFO: Bootloader /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/bootloader/Darwin-64bit/runw

13457 INFO: checking EXE

13457 INFO: Building EXE because EXE-00.toc is non existent

13457 INFO: Building EXE from EXE-00.toc

13457 INFO: Appending archive to EXE /Users/eric/Desktop/Product/build/main/Form

13463 INFO: Fixing EXE for code signing /Users/eric/Desktop/Product/build/main/Form

13467 INFO: Building EXE from EXE-00.toc completed successfully.

13469 INFO: checking COLLECT

13469 INFO: Building COLLECT because COLLECT-00.toc is non existent

13469 INFO: Building COLLECT COLLECT-00.toc

15388 INFO: Building COLLECT COLLECT-00.toc completed successfully.

15400 INFO: checking BUNDLE

15400 INFO: Building BUNDLE because BUNDLE-00.toc is non existent

WARNING: The output directory "/Users/eric/Desktop/Product/dist/Form" and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)


This is also my updated spec file:

# -*- mode: python ; coding: utf-8 -*-


import os


spec_root = os.path.abspath(SPECPATH)

block_cipher = None

app_name='Form'

mac_icon = 'app_icon.icns'


a = Analysis(['main.py'],

             pathex=[spec_root],

             binaries=[],

             datas=[('*.kv','.'),('*.png','.')],

             hiddenimports=[],

             hookspath=[],

             runtime_hooks=[],

             excludes=['_tkinter', 'Tkinter', 'enchant', 'twisted'],

             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 )


coll = COLLECT(exe,

               a.binaries,

               a.zipfiles,

               a.datas,

               strip=False,

               upx=False,

               name=app_name)


app = BUNDLE(exe,

             name=app_name,

             icon=mac_icon,

             bundle_identifier=None)


Maybe it would be easier/better to make some executable that just opens the working file? Also if this is a good idea, then I don't know how to do it so I would need assistance. Finally, thank you for all your help and time so far!

Eric B

unread,
Apr 4, 2020, 12:04:30 PM4/4/20
to Kivy users support
I don't think it it included everything I put in my last message so this is the cut off part (still look at the highlighted part of the console):

Also this is my new updated spec file:

Elliot Garbus

unread,
Apr 4, 2020, 12:09:38 PM4/4/20
to kivy-...@googlegroups.com

When you see the message:

WARNING: The output directory "/Users/eric/Desktop/Product/dist/Form" and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)

Press y

 

 

 

From: Eric B
Sent: Saturday, April 4, 2020 9:04 AM
To: Kivy users support
Subject: Re: [kivy-users] Creating an Executable on Mac

 

I don't think it it included everything I put in my last message so this is the cut off part (still look at the highlighted part of the console):

--

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.

Eric B

unread,
Apr 4, 2020, 12:43:49 PM4/4/20
to Kivy users support
When i press y, it now no longer creates a .app file for me to open

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

Elliot Garbus

unread,
Apr 4, 2020, 12:49:53 PM4/4/20
to kivy-...@googlegroups.com

What is in dist?

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/9bb2417a-0751-40f3-b0da-90c5ae5b6638%40googlegroups.com.

 

Eric B

unread,
Apr 4, 2020, 1:10:26 PM4/4/20
to Kivy users support
Almost nothing, see attached photos to see everything in it
Screen Shot 2020-04-04 at 1.09.42 PM.png
Screen Shot 2020-04-04 at 1.08.28 PM.png
Screen Shot 2020-04-04 at 1.08.32 PM.png
Screen Shot 2020-04-04 at 1.08.49 PM.png
Screen Shot 2020-04-04 at 1.08.54 PM.png

Elliot Garbus

unread,
Apr 4, 2020, 1:14:47 PM4/4/20
to kivy-...@googlegroups.com

What is in dist/form?

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/9fb7adb0-635f-4987-b8b6-b714da7ed3e7%40googlegroups.com.

 

Eric B

unread,
Apr 4, 2020, 1:28:06 PM4/4/20
to Kivy users support
it goes
Dist
   Form
      Contents
         Frameworks
         Info.plist
         MacOS
            Form executable file thingy
         Reources
            app_icon.icns

Elliot Garbus

unread,
Apr 4, 2020, 2:17:56 PM4/4/20
to kivy-...@googlegroups.com
Delete the build and dist dirs and build again 

Sent from my iPhone

On Apr 4, 2020, at 10:33 AM, Eric B <ericis...@gmail.com> wrote:


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/eca1307f-309e-4b80-9a9a-cb22e5ffffd8%40googlegroups.com.

Eric B

unread,
Apr 4, 2020, 2:23:26 PM4/4/20
to Kivy users support
It does the same thing every time, it still didnt make any form.app file even if I did N instead

Eric B

unread,
Apr 4, 2020, 7:12:01 PM4/4/20
to Kivy users support
So I'm trying to do this again for another GUI I made but I haven't been able to make it work. 
In this folder I have my display.py my display.kv my app_icon.icns and my display.spec file all in the same folder.
In my display.spec file I have this:

# -*- mode: python ; coding: utf-8 -*-

import os

spec_root = os.path.abspath(SPECPATH)
block_cipher = None
app_name='Display'
mac_icon = 'app_icon.icns'

a = Analysis(['display.py'],
             pathex=['spec_root'],
             binaries=[],
             datas=[('*.kv','.')],
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=['_tkinter', 'Tkinter', 'enchant', 'twisted'],
             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,
          a.binaries,
          a.zipfiles,
          a.datas,
          [],
          name='display',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          upx_exclude=[],
          runtime_tmpdir=None,
          console=False )

coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=False,
               name=app_name)

app = BUNDLE(exe,
             name=app_name + '.app',
             icon=mac_icon,
             bundle_identifier=None)

And when I use this command to make the executable: pyinstaller -spec display.spec

This was the kivy log:
[INFO   ] Logger: Record log in /Users/eric/.kivy/logs/kivy_20-04-04_111.txt
[INFO   ] Text: Provider: sdl2
[INFO   ] Video: Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)

I cannot open the Display.app because it says its filetype is not supported on this type of mac

Elliot Garbus

unread,
Apr 4, 2020, 7:35:24 PM4/4/20
to kivy-...@googlegroups.com
In pathex you need to put spec_root, not ‘spec_root’

I suggest you create a sub directory under your main project, put the original spec file I gave you. Edit minimally.  Switch to the directory that contains the spec file and do a build. 

Sent from my iPhone

On Apr 4, 2020, at 4:12 PM, Eric B <ericis...@gmail.com> wrote:


--
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/f4b1d158-4b4e-4eac-bb42-de186e8ef6bd%40googlegroups.com.

Eric B

unread,
Apr 4, 2020, 8:09:00 PM4/4/20
to Kivy users support
It works including the .kv file and all so it looks nice but, once I open it it opens for like a second and then immideatly closes.
This is the log:
[INFO   ] Logger: Record log in /Users/eric/.kivy/logs/kivy_20-04-04_116.txt
[INFO   ] Kivy: v1.11.1
[INFO   ] Kivy: Installed at "/Users/eric/Desktop/Display/dist/Display.app/Contents/MacOS/kivy/__init__.pyc"
[INFO   ] Python: v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 
[Clang 6.0 (clang-600.0.57)]
[INFO   ] Python: Interpreter at "/Users/eric/Desktop/Display/dist/Display.app/Contents/MacOS/Display"
[INFO   ] Factory: 184 symbols loaded
[INFO   ] Image: Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] Window: Provider: sdl2
[INFO   ] GL: Using the "OpenGL ES 2" graphics system
[INFO   ] GL: Backend used <sdl2>
[INFO   ] GL: OpenGL version <b'2.1 INTEL-10.36.26'>
[INFO   ] GL: OpenGL vendor <b'Intel Inc.'>
[INFO   ] GL: OpenGL renderer <b'Intel(R) HD Graphics 6000'>
[INFO   ] GL: OpenGL parsed version: 2, 1
[INFO   ] GL: Shading version <b'1.20'>
[INFO   ] GL: Texture max size <16384>
[INFO   ] GL: Texture max units <16>
[INFO   ] Window: auto add sdl2 input provider
[INFO   ] Window: virtual keyboard not allowed, single mode, not docked
[INFO   ] Base: Start application main loop
[INFO   ] Text: Provider: sdl2
[INFO   ] GL: NPOT texture support is available
[INFO   ] Base: Leaving application in progress...
[WARNING] stderr: Traceback (most recent call last):
[WARNING] stderr:   File "display.py", line 97, in <module>
[WARNING] stderr:   File "kivy/app.py", line 855, in run
[WARNING] stderr:   File "kivy/base.py", line 504, in runTouchApp
[WARNING] stderr:   File "kivy/core/window/window_sdl2.py", line 747, in mainloop
[WARNING] stderr:   File "kivy/core/window/window_sdl2.py", line 479, in _mainloop
[WARNING] stderr:   File "kivy/base.py", line 339, in idle
[WARNING] stderr:   File "kivy/clock.py", line 591, in tick
[WARNING] stderr:   File "kivy/_clock.pyx", line 384, in kivy._clock.CyClockBase._process_events
[WARNING] stderr:   File "kivy/_clock.pyx", line 414, in kivy._clock.CyClockBase._process_events
[WARNING] stderr:   File "kivy/_clock.pyx", line 412, in kivy._clock.CyClockBase._process_events
[WARNING] stderr:   File "kivy/_clock.pyx", line 167, in kivy._clock.ClockEvent.tick
[WARNING] stderr:   File "display.py", line 22, in email_read
[WARNING] stderr:   File "imapclient/imapclient.py", line 254, in __init__
[WARNING] stderr:   File "imapclient/imapclient.py", line 289, in _create_IMAP4
[WARNING] stderr:   File "imapclient/tls.py", line 44, in __init__
[WARNING] stderr:   File "imaplib.py", line 198, in __init__
[WARNING] stderr:   File "imapclient/tls.py", line 50, in open
[WARNING] stderr:   File "imapclient/tls.py", line 32, in wrap_socket
[WARNING] stderr:   File "ssl.py", line 423, in wrap_socket
[WARNING] stderr:   File "ssl.py", line 870, in _create
[WARNING] stderr:   File "ssl.py", line 1139, in do_handshake
[WARNING] stderr: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)

Do you know how to fix this? I can post my display.py code if u need

Elliot Garbus

unread,
Apr 5, 2020, 1:25:28 AM4/5/20
to kivy-...@googlegroups.com
Post the code. I expect you need to add some exception handling to catch this exception 

Sent from my iPad

On Apr 4, 2020, at 5:09 PM, Eric B <ericis...@gmail.com> wrote:


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

Eric B

unread,
Apr 5, 2020, 9:19:11 AM4/5/20
to Kivy users support
I was able to kind of fix this, but the way it gets fixed is I have to run a File in Mactintosh HD > Applications > Python 3.7 > Install Certificates.command. This then makes it work if I run the program on other people computers but then they wouldalso need to install python 3.7 and pip for this all to work.
Here is my code though:
import kivy
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
import imapclient
import pyzmail
from kivy.clock import Clock
from kivy.uix.recycleview import RecycleView
from kivy.uix.recycleview.views import RecycleDataViewBehavior
from datetime import date
import os

add_element = False
element = 1
std_name = ["Student Name"]
grade = ["Grade"]
reason = ["Reason"]
return_time = ["Return Time"]
leave_time = ["Leave Time"]


def email_read(dt):
    mail_obj = imapclient.IMAPClient('imap.gmail.com', 993) #I'm pretty sure this was what caused the error at the bottom
    mail_obj.login('formem...@gmail.com', 'gvauyhpltyyuyinp')
    mail_obj.select_folder('INBOX', readonly=False)
    uid = mail_obj.search(['UNSEEN'])
    global add_element
    if uid == []:
        add_element = False
    else:
        add_element = True
    for i in uid:
        raw_msg = mail_obj.fetch(i, ['BODY[]'])
        msg = pyzmail.PyzMessage.factory(raw_msg[i][b'BODY[]'])
        ref_msg = msg.text_part.get_payload().decode("utf-8").strip('\r\n').replace("^", ":").split("#")
        std_name.append(ref_msg[0])
        grade.append(ref_msg[1])
        reason.append(ref_msg[2])
        leave_time.append(ref_msg[4])
        return_time.append(ref_msg[3])
        mail_obj.delete_messages(i)
    mail_obj.logout()

'''
def log_info():
    global element
    current_date = date.today().__str__()
    file_path = os.path.join('Logs', current_date)

    with open(file_path + '.txt', 'a+') as f:
        text = "Student Name: " + std_name[element] + ' ' + "Grade: " + grade[element] + ' ' + "Reason: " + \
               reason[element] + ' ' + "Leave Time: " + leave_time[element] + ' ' + "Return Time: " + \
               return_time[element] + '\n'
        f.write(text)
'''

class CustLabel(GridLayout, RecycleDataViewBehavior):
    cols = 5

    def refresh_view_attrs(self, rv, index, data):
        self.ids['std'].text = data['std']['text']
        self.ids['grd'].text = data['grd']['text']
        self.ids['res'].text = data['res']['text']
        self.ids['ct'].text = data['ct']['text']
        self.ids['rt'].text = data['rt']['text']
        return super(CustLabel, self).refresh_view_attrs(rv, index, data)


class StudentView(RecycleView):
    Clock.schedule_interval(email_read, 2)

    def __init__(self, **kwargs):
        super(StudentView, self).__init__(**kwargs)
        self.data = []
        paired_items = zip(std_name, grade, reason, leave_time, return_time)
        for i1, i2, i3, i4, i5 in paired_items:
            d = {'std': {'text': i1}, 'grd': {'text': i2}, 'res': {'text': i3},
                 'ct': {'text': i4}, 'rt': {'text': i5}}
            self.data.append(d)
        Clock.schedule_interval(self.update_list, 2)

    def update_list(self, dt):
        global element
        if add_element:
            d = {'std': {'text': std_name[element]}, 'grd': {'text': grade[element]}, 'res': {'text': reason[element]},
                 'ct': {'text': leave_time[element]}, 'rt': {'text': return_time[element]}}
            self.data.append(d)
            #log_info()
            element += 1


class DisplayApp(App):
    def build(self):
        return StudentView()


if __name__ == '__main__':
    DisplayApp().run()

Elliot Garbus

unread,
Apr 5, 2020, 11:00:21 AM4/5/20
to kivy-...@googlegroups.com

I found this: https://medium.com/@yen.hoang.1904/resolve-issue-ssl-certificate-verify-failed-when-trying-to-open-an-url-with-python-on-macos-46d868b44e10

 

I suspect the ‘install certificates’ command  is getting installed with your bundle by default, search your build dir to check.  If not try adding it to hidden imports, or look at the pyinstaller documentation for adding a binary file to the bundle.

 

In your code add a try/except block around the code that includes the call that is throwing the exception.  In the except block, use the suprocess call to execute the ‘install certificates’ command.  https://docs.python.org/3.7/library/subprocess.html

 

 

 

From: Eric B
Sent: Sunday, April 5, 2020 6:19 AM
To: Kivy users support
Subject: Re: [kivy-users] Creating an Executable on Mac

 

I was able to kind of fix this, but the way it gets fixed is I have to run a File in Mactintosh HD > Applications > Python 3.7 > Install Certificates.command. This then makes it work if I run the program on other people computers but then they wouldalso need to install python 3.7 and pip for this all to work.

--

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.

Eric B

unread,
Apr 5, 2020, 2:40:57 PM4/5/20
to Kivy users support
I'm unsure how I would go about doing this. I know that I would do something along the lines of:
Try:
   logging  in 
Except (ssl error excpetion)
   subprocess thingy

But I don't know how to do the subprocess thingy part or what exception it would give. Any help is appreciated

Elliot Garbus

unread,
Apr 5, 2020, 2:54:41 PM4/5/20
to kivy-...@googlegroups.com

Here is info on the subprocess: https://pymotw.com/3/subprocess/index.html

 

I would expect something like:

import subprocess

 

subprocess.run(‘install certificates’)   # think of this as running something on the command line

 

I think the exception you are catching is: ssl.SSLCertVerificationError

 

In development do this:

 

try:

   log in

except Exception as e:

    print(f’The Exception was {e}’)

 

and use that data to set the exception you are catching.  

 

From: Eric B
Sent: Sunday, April 5, 2020 11:41 AM
To: Kivy users support
Subject: Re: [kivy-users] Creating an Executable on Mac

 

I'm unsure how I would go about doing this. I know that I would do something along the lines of:
Try:

--

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.

Eric B

unread,
Apr 5, 2020, 3:38:59 PM4/5/20
to Kivy users support
When I try that try except statement, it doesn't print out the exception. It just ignores that and then says Unbouund local error: local variable 'mail_obj'


On Sunday, April 5, 2020 at 2:54:41 PM UTC-4, Elliot Garbus wrote:

Here is info on the subprocess: https://pymotw.com/3/subprocess/index.html

 

I would expect something like:

import subprocess

 

subprocess.run(‘install certificates’)   # think of this as running something on the command line

 

I think the exception you are catching is: ssl.SSLCertVerificationError

 

In development do this:

 

try:

   log in

except Exception as e:

    print(f’The Exception was {e}’)

 

and use that data to set the exception you are catching.  

 

From: Eric B
Sent: Sunday, April 5, 2020 11:41 AM
To: Kivy users support
Subject: Re: [kivy-users] Creating an Executable on Mac

 

I'm unsure how I would go about doing this. I know that I would do something along the lines of:
Try:

   logging  in 
Except (ssl error excpetion)
   subprocess thingy

 

But I don't know how to do the subprocess thingy part or what exception it would give. Any help is appreciated

--
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-...@googlegroups.com.

Eric B

unread,
Apr 5, 2020, 3:44:43 PM4/5/20
to Kivy users support
Also how would I add the install certificates to the bundle in the spec file

Elliot Garbus

unread,
Apr 5, 2020, 4:51:13 PM4/5/20
to kivy-...@googlegroups.com

Try using just:

 

except:

    print(‘Caught’)

    exit(-1)

 

show the trace log.

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/76ecd33d-7061-496c-900d-322e018c20c5%40googlegroups.com.

 

Eric B

unread,
Apr 5, 2020, 5:11:53 PM4/5/20
to Kivy users support
This is the error I get when I do that:

[INFO   ] Logger: Record log in /Users/h/.kivy/logs/kivy_20-04-05_14.txt
[INFO   ] Kivy: v1.11.1
[INFO   ] Kivy: Installed at "/private/var/folders/br/sxpnwqvn0p72cmhfz7vgm67r0000gn/T/AppTranslocation/617DB5B8-61CB-4648-9131-54FEFFA16000/d/Display-10.app/Contents/MacOS/kivy/__init__.pyc"
[INFO   ] Python: v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 
[Clang 6.0 (clang-600.0.57)]
[INFO   ] Python: Interpreter at "/private/var/folders/br/sxpnwqvn0p72cmhfz7vgm67r0000gn/T/AppTranslocation/617DB5B8-61CB-4648-9131-54FEFFA16000/d/Display-10.app/Contents/MacOS/Display"
[INFO   ] Factory: 184 symbols loaded
[INFO   ] Image: Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] Window: Provider: sdl2
[INFO   ] GL: Using the "OpenGL ES 2" graphics system
[INFO   ] GL: Backend used <sdl2>
[INFO   ] GL: OpenGL version <b'2.1 INTEL-10.2.37'>
[INFO   ] GL: OpenGL vendor <b'Intel Inc.'>
[INFO   ] GL: OpenGL renderer <b'Intel HD Graphics 3000 OpenGL Engine'>
[INFO   ] GL: OpenGL parsed version: 2, 1
[INFO   ] GL: Shading version <b'1.20'>
[INFO   ] GL: Texture max size <8192>
[INFO   ] GL: Texture max units <16>
[INFO   ] Window: auto add sdl2 input provider
[INFO   ] Window: virtual keyboard not allowed, single mode, not docked
[INFO   ] Base: Start application main loop
[INFO   ] Text: Provider: sdl2
[INFO   ] GL: NPOT texture support is available
[INFO   ] Base: Leaving application in progress...
[WARNING] stderr: Traceback (most recent call last):
[WARNING] stderr:   File "display.py", line 24, in email_read
[WARNING] stderr:   File "imapclient/imapclient.py", line 254, in __init__
[WARNING] stderr:   File "imapclient/imapclient.py", line 289, in _create_IMAP4
[WARNING] stderr:   File "imapclient/tls.py", line 44, in __init__
[WARNING] stderr:   File "imaplib.py", line 198, in __init__
[WARNING] stderr:   File "imapclient/tls.py", line 50, in open
[WARNING] stderr:   File "imapclient/tls.py", line 32, in wrap_socket
[WARNING] stderr:   File "ssl.py", line 423, in wrap_socket
[WARNING] stderr:   File "ssl.py", line 870, in _create
[WARNING] stderr:   File "ssl.py", line 1139, in do_handshake
[WARNING] stderr: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)
[WARNING] stderr: 
[WARNING] stderr: During handling of the above exception, another exception occurred:
[WARNING] stderr: 
[WARNING] stderr: Traceback (most recent call last):
[WARNING] stderr:   File "display.py", line 103, in <module>
[WARNING] stderr:   File "kivy/app.py", line 855, in run
[WARNING] stderr:   File "kivy/base.py", line 504, in runTouchApp
[WARNING] stderr:   File "kivy/core/window/window_sdl2.py", line 747, in mainloop
[WARNING] stderr:   File "kivy/core/window/window_sdl2.py", line 479, in _mainloop
[WARNING] stderr:   File "kivy/base.py", line 339, in idle
[WARNING] stderr:   File "kivy/clock.py", line 591, in tick
[WARNING] stderr:   File "kivy/_clock.pyx", line 384, in kivy._clock.CyClockBase._process_events
[WARNING] stderr:   File "kivy/_clock.pyx", line 414, in kivy._clock.CyClockBase._process_events
[WARNING] stderr:   File "kivy/_clock.pyx", line 412, in kivy._clock.CyClockBase._process_events
[WARNING] stderr:   File "kivy/_clock.pyx", line 167, in kivy._clock.ClockEvent.tick
[WARNING] stderr:   File "display.py", line 27, in email_read
[WARNING] stderr: NameError: name 'exit' is not defined

This is what I put for the python code the function starts on line 22:

def email_read(dt):
    try:
        mail_obj = imapclient.IMAPClient('imap.gmail.com', 993)
    except:
        print('Caught')
        exit(-1)
        
    mail_obj.login('formem...@gmail.com', 'gvauyhpltyyuyinp')
    mail_obj.select_folder('INBOX', readonly=False)
    uid = mail_obj.search(['UNSEEN'])
    global add_element
    if uid == []:
        add_element = False
    else:
        add_element = True
    for i in uid:
        raw_msg = mail_obj.fetch(i, ['BODY[]'])
        msg = pyzmail.PyzMessage.factory(raw_msg[i][b'BODY[]'])
        ref_msg = msg.text_part.get_payload().decode("utf-8").strip('\r\n').replace("^", ":").split("#")
        std_name.append(ref_msg[0])
        grade.append(ref_msg[1])
        reason.append(ref_msg[2])
        leave_time.append(ref_msg[4])
        return_time.append(ref_msg[3])
        mail_obj.delete_messages(i)
    mail_obj.logout()

Elliot Garbus

unread,
Apr 5, 2020, 5:18:07 PM4/5/20
to kivy-...@googlegroups.com

Oops

 

Add

from sys import exit

 

From: Eric B
Sent: Sunday, April 5, 2020 2:11 PM
To: Kivy users support
Subject: Re: [kivy-users] Creating an Executable on Mac

 

This is the error I get when I do that:

--

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.

Eric B

unread,
Apr 5, 2020, 5:57:35 PM4/5/20
to Kivy users support

This is the log I got, I highlighted theimportant part


Last login: Sun Apr  5 17:56:18 on ttys000

kween:~b$ /Users/h/Desktop/Display-11.app/Contents/MacOS/Display ; exit;

[INFO   ] [Logger      ] Record log in /Users/h/.kivy/logs/kivy_20-04-05_19.txt

[INFO   ] [Kivy        ] v1.11.1

[INFO   ] [Kivy        ] Installed at "/Users/h/Desktop/Display-11.app/Contents/MacOS/kivy/__init__.pyc"

[INFO   ] [Python      ] v3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 

[Clang 6.0 (clang-600.0.57)]

[INFO   ] [Python      ] Interpreter at "/Users/h/Desktop/Display-11.app/Contents/MacOS/Display"

[INFO   ] [Factory     ] 184 symbols loaded

[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)

[INFO   ] [Window      ] Provider: sdl2

[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system

[INFO   ] [GL          ] Backend used <sdl2>

[INFO   ] [GL          ] OpenGL version <b'2.1 INTEL-10.2.37'>

[INFO   ] [GL          ] OpenGL vendor <b'Intel Inc.'>

[INFO   ] [GL          ] OpenGL renderer <b'Intel HD Graphics 3000 OpenGL Engine'>

[INFO   ] [GL          ] OpenGL parsed version: 2, 1

[INFO   ] [GL          ] Shading version <b'1.20'>

[INFO   ] [GL          ] Texture max size <8192>

[INFO   ] [GL          ] Texture max units <16>

[INFO   ] [Window      ] auto add sdl2 input provider

[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked

[INFO   ] [Base        ] Start application main loop

[INFO   ] [Text        ] Provider: sdl2

[INFO   ] [GL          ] NPOT texture support is available

Caught

The Exception was [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)

[INFO   ] [Base        ] Leaving application in progress...

logout

Saving session...

...copying shared history...

...saving history...truncating history files...

...completed.

 

[Process completed]

 



Elliot Garbus

unread,
Apr 5, 2020, 6:19:17 PM4/5/20
to kivy-...@googlegroups.com

You’ve caught the exception, now use subprocess to install the certificate.

After that is working you can try to be more specific on the exception.  Catching all exceptions like that is bad form – and can hide bugs.

 

From: Eric B
Sent: Sunday, April 5, 2020 2:57 PM
To: Kivy users support
Subject: Re: [kivy-users] Creating an Executable on Mac

 

This is the log I got, I highlighted theimportant part

--

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.

Eric B

unread,
Apr 6, 2020, 9:29:37 AM4/6/20
to Kivy users support
I made it work, thanks for all your help!

Elliot Garbus

unread,
Apr 6, 2020, 9:32:05 AM4/6/20
to kivy-...@googlegroups.com

Excellent!

 

 

 

From: Eric B
Sent: Monday, April 6, 2020 6:29 AM
To: Kivy users support
Subject: Re: [kivy-users] Creating an Executable on Mac

 

I made it work, thanks for all your help!

--

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.

Reply all
Reply to author
Forward
0 new messages