error: [Errno 2] No such file or directory: '/opt/anaconda3/lib/python3.9/site-packages/zmq/.dylibs'

38 Views Asked by At

I have seen this exact question here but the only given answer doesnt help me.

I am trying to convert my tkinter app (.py) to .app by using py2app.

Creating the alias via python setup.py py2app -A works fine, but if i try building without -A i get the following error:

error: [Errno 2] No such file or directory: '/opt/anaconda3/lib/python3.9/site-packages/zmq/.dylibs'

I have the zmq error but no .dylibs file, even if i press cmd + shift + period. I have no other python folders like the answer given here

Can anyone tell me how to fix my problem?

EDIT:

i tried creating smaller reproducible examples like Mike suggested, which only give more errors. To be honest i dont know how to show my py2app configuration (?) but here is what ive done:

My setup.py for the original app:

"""
This is a setup.py script generated by py2applet

Usage:
    python setup.py py2app
"""

from setuptools import setup

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

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

Test-App with all my used modules:

from tkinter import *
from tkinter import ttk, filedialog
import tkintertable
from tkintertable import TableCanvas, TableModel
import numpy as np
from PIL import Image, ImageTk
import pandas as pd
import matplotlib.pyplot as plt
import scipy.optimize as opt
import matplotlib.patches as ptc

def change_color(widget):
    colors = [ "red", "green", "yellow", "blue", "orange",         "purple", "magenta" ]
    x = np.random.randint(0,len(colors))
    widget.configure(bg = colors[x], text = colors[x])

app = Tk()

app_width = app.winfo_screenwidth()*0.5
app_height = app.winfo_screenheight()*0.5
app_x = app.winfo_screenwidth()/2 - app_width/2
app_y = app.winfo_screenheight()/2 - app_height/2
app.geometry("%dx%d+%d+%d" % (app_width, app_height, app_x,     app_y))
app.title("Testapp")

app.columnconfigure((0,2), weight = 1, uniform = "a")
app.columnconfigure(1, weight = 8, uniform = "a")

app.rowconfigure((0,2), weight = 1, uniform = "a")
app.rowconfigure(1, weight = 8, uniform = "a")

lbl = Label(app, text = "Hello There!")
lbl.grid(row = 0, column = 1)

square = Label(app, width = 50, height = 50, text = "red", bg =     "red", highlightbackground = "black", highlightthickness = 5)
square.grid(row = 1, column = 1)

btn = Button(app, text = "Change Color", command = lambda :     change_color(square))
btn.grid(row = 2, column = 1)

app.mainloop()

=> produces the same error

Test app with no further contents:

import tkinter as tk
from tkinter import *

app = Tk()
app.geometry("250x250")
lbl = Label(app, text = "Hello World")
lbl.pack()

app.mainloop()

Thisone i can turn into an app but when i try to launch it, it crashes and i get a bunch of errors saying it cant find:

libffi.8.dylib

All apps work fine if i run the python file, all apps work in alias mode :(

0

There are 0 best solutions below