Hello! Thank you for your help and for your patience with me, I did try to find the answer myself by searching for many hours on the web but I'm still getting "Launch Error" when I use a different computer.
Because the app works great on my computer, I feel like the issue is related to the modules.
- I tried to add the modules directly inside the app once it was created but then it tells me that my app is damaged
- I tried using "includes" and "packages" separately and together but it still doesn't work
- I tried adding executable_stub = link to my .dylib python file > it says "Unknown distribution option"
- I'm on M1 and I'm trying to see if the app works on my other computer on Intel > It seems that my app is universal:
Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64
- Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64
- Mach-O 64-bit executable arm64]
/Users/***PycharmProjects/TheYouRLator/dist/TheYouRLator.app/Contents/MacOS/TheYouRLator (for architecture x86_64): Mach-O 64-bit executable x86_64
/Users/***/PycharmProjects/TheYouRLator/dist/TheYouRLator.app/Contents/MacOS/TheYouRLator (for architecture arm64): Mach-O 64-bit executable arm64
Here are the modules that I'm using:
import pandas as pd
import subprocess
import tkinter.filedialog as fd
import tkinter as tk
from tkinter import Button
import xlwings as xw
from pytube import YouTube
from openpyxl.utils import get_column_letter
Here is my setup.py in its current state:
from setuptools import setup
APP = ['TheYouRLator.py']
OPTIONS = {'packages': ["tkinter", "pytube", "openpyxl.utils"], 'includes': ["subprocess", "tkinter", "tkinter.filedialog", "pandas", "xlwings"]}
setup(
app=APP,
executable_stub = "/Library/Frameworks/Python.framework/Versions/3.11/lib/libpython3.11.dylib",
data_files=[],
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
UPDATE: By running it in the terminal, it says "Unable to import required dependencies: numpy". I don't even know what that is...but I made sure that I have the last version of this thing installed and it's still not working... It looks like the module Pandas is messing things up??
Traceback (most recent call last):
File "/Users/*/Downloads/TheYouRLator 2.app/Contents/Resources/__boot__.py", line 161, in <module>
_run()
File "/Users/*/Downloads/TheYouRLator 2.app/Contents/Resources/__boot__.py", line 84, in _run
exec(compile(source, path, "exec"), globals(), globals())
File "/Users/*/Downloads/TheYouRLator 2.app/Contents/Resources/TheYouRLator.py", line 3, in <module>
import pandas as pd
File "/Users/*/Downloads/TheYouRLator 2.app/Contents/Resources/lib/python3.11/pandas/__init__.py", line 16, in <module>
raise ImportError(
ImportError: Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.11 from "/Users/*/Downloads/TheYouRLator 2.app/Contents/MacOS/python"
* The NumPy version is: "1.24.1"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: dlopen(/Users/*/Downloads/TheYouRLator 2.app/Contents/Resources/lib/python3.11/numpy/core/_multiarray_umath.cpython-311-darwin.so, 2): no suitable image found. Did find:
/Users/*/Downloads/TheYouRLator 2.app/Contents/Resources/lib/python3.11/numpy/core/_multiarray_umath.cpython-311-darwin.so: mach-o, but wrong architecture
/Users/*/Downloads/TheYouRLator 2.app/Contents/Resources/lib/python3.11/numpy/core/_multiarray_umath.cpython-311-darwin.so: mach-o, but wrong architecture
2022-12-27 15:07:42.916 TheYouRLator[47286:309345] Launch error