0

I have made an app with py2app for MacOS (Mojave) with python 3.7.

For make the app I'm using this command python3 setup.py py2app -A when I open the app, it closes and log me out of the account every time.

I tried using different version of py2app from 0.14 to 0.19 but I have the same issue.

0.13 version or less had problems on imports. I also tried with 0.12 version modifying the files of py2app library for avoiding issues, but I have the same problem

setup.py

from setuptools import setup

APP = ['MyApplication.py']
DATA_FILES = []
OPTIONS = {}

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)

Myapplication.py


import tkinter as tk

if __name__ == '__main__':
    root = tk.Tk()
    root.title("Sandwich")
    tk.Button(root, text="My first App").pack()
    tk.mainloop()

M. T.
  • 396
  • 6
  • 24
  • what error does it give you? – Samuel Kazeem Aug 31 '19 at 12:55
  • The app log me out I can't see the error. Even with ptb trace I can't get the error, because when the app load tkinter after the `if __name__ ...` I'm logout. – M. T. Aug 31 '19 at 13:00
  • 1
    Run the app from your terminal `./dist/MyApplication.app/Contents/MacOS/MyApplication`, it ought to give you an error. Without the error, the problem is difficult to trace. – Samuel Kazeem Aug 31 '19 at 13:12
  • `-> root.title("Sandwich") (Pdb) 2019-08-31 15:22:05.538 MyApplication[2933:6227251] CGSTrackingRegionSetIsEnabled returned CG error 268435459 2019-08-31 15:22:05.538 MyApplication[2933:6227251] CGSTrackingRegionSetIsEnabled returned CG error 268435459` this is the error but I saw it only before I login again. – M. T. Aug 31 '19 at 13:24
  • you should have `root.mainloop()` not `tk.mainloop()` – Samuel Kazeem Aug 31 '19 at 13:29
  • that's not the problem, I have the same issue... – M. T. Aug 31 '19 at 13:32
  • You are not alone on this, check out this thread https://bugs.python.org/issue37833 . I'll recommend you use another freezing tool like pyinstaller if the script works normally when run directly. Maybe py2app just isn't compatible with your environment setup. – Samuel Kazeem Aug 31 '19 at 13:58

0 Answers0