How to fix "ApplePersistenceIgnoreState"

Hello im trying to create a Python GUI and everything works fine until I tried to import a new font using pyglet and now im getting an apple persistent error (im on Mac) ive tried command similar to these and changed it to python3

defaults write org.python.python ApplePersistenceIgnoreState NO

The full error as well as my source code will be at the bottom please help

from voiceControl import *
from timeday import *
from tkinter import *
from tempature import *
from tkinter import messagebox
import datetime
import pytz
import pyttsx3
import PyObjCTools
import os, ssl
import wolframalpha 
import wikipedia 
import pyglet, os

# grabs custom font
pyglet.font.add_file('fonts/AmazonEmberHe.ttf')  # Your TTF file name here

# API creds
base_url = ""
client = wolframalpha.Client("4EGT3Q-RXEKEQK7AY")

engine = pyttsx3.init()
engine.say("voice has loaded correctly")

def click():
    if (not os.environ.get('PYTHONHTTPSVERIFY', '') and getattr(ssl, '_create_unverified_context', None)): 
        ssl._create_default_https_context = ssl._create_unverified_context
        enteredText = ask.get() #collects the tect from the text box
            wiki_res = wikipedia.summary(enteredText, sentences=2)

        except wikipedia.exceptions.PageError:
            res = client.query(enteredText)
            wolfram_res = next(res.results).text

window = Tk()
window.title("Pyda GUI")

C = Canvas(window, bg="blue", height=250, width=300)
filename = PhotoImage(file = "img/bab8b3e0bcc30e3c48a890e07ef01033.gif")
background_label = Label(window, image=filename), y=0, relwidth=1, relheight=1)

# tempature
Label(window, text=tempDisplay, bg=None, fg="black", font="AmazonEmberHe 12 bold") .grid(row=0, column=0, sticky=W)

# time
Label(window, text=time, bg=None, fg="black", font="AmazonEmberHe 12 bold") .grid(row=1, column=0, sticky=W)

# date
Label(window, text=date, bg=None, fg="black", font="AmazonEmberHe 12 bold") .grid(row=2, column=0, sticky=W)

# ask pyda text
Label(window, text="ask pyda", bg=None, fg="black", font="AmazonEmberHe 12 bold") .grid(row=3, column=0, sticky=W)

# enter text
ask = Entry(window, width=20, bg=None, fg="black")
ask.grid(row=4, column=0, sticky=W)

# submit button
Button(window, text="Submit", width=6, command=click, bg=None, fg="white") .grid(row=5, column=0, sticky=W)


Here is the error

2020-11-21 13:25:43.560 Python[25836:742664] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/mg/hnw8xjrx4mg34rpkhch72mqr0000gn/T/org.python.python.savedState

Read more here:

Content Attribution

This content was originally published by Daniel Caminero at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: