Open ghost opened 2 years ago
Have you installed the requirements?
If not, first create a virtual env if it's not already done:
python3 -m venv venv --upgrade-deps
source ./venv/bin/activate
Then enter the following commands:
pip install pip-tools
pip-compile --upgrade requirements.in
pip install -r requirements.txt
Then retry to build with python3 MACOS-video-dl.py py2app
I followed the above steps. Like the results I compiled myself, I also compiled it successfully with your steps, but the result is still the same as before. The icon keeps beating, but the application window does not appear, and there is no window prompting permissions or anything else.
The warnings are the same? If you only want to use the program, I just uploaded a .dmg in the latest release. You'll need to disable .dmg's verification as it's currently no signed with an Apple compatible certificate: https://www.macworld.com/article/672947/how-to-open-a-mac-app-from-an-unidentified-developer.html
I downloaded the dmg you uploaded. With the same problem, the icon keeps beating and the app can't start.
In addition, I forked this repository and ran the building workflow with github action to get an x64 application for macos, which could not start either.
Can you try with the latest version?
tried the latest release and the icon keeps beating on dock, issue is still not solved
i think i found the reason why app not running on macOS
first run sudo pyinstaller -D app.py
second run ./dist/app/app
it gives error below
Mac OS Version is 13.0.1 and patch enabled so applying the patch
Applyting Mac OS 12.3+ Alpha Channel fix. Your default Alpha Channel is now 0.99
Traceback (most recent call last):
File "app.py", line 13, in <module>
File "updater/updater.py", line 43, in __init__
File "updater/updater.py", line 137, in _get_versions_json
PermissionError: [Errno 13] Permission denied: 'versions.zip'
[6557] Failed to execute script 'app' due to unhandled exception!
so there is some permission issue when running the app
thrid run 'sudo ./dist/app/app', app works, and sould use sudo
every time of running the app binary, or if copy all contents in app directory to a new created floder outside the project folder, and run ./app
it does not need sudo
if pack a standalone app for mac by sudo pyinstaller -D -w app.py
it will crash quit after double click the app icon, should be the reason showed above.
so how to solve this PermissionError: [Errno 13] Permission denied: 'versions.zip'
, there is no such file in app directory.
i commented code related to updater in app.py
#from updater.updater import Updater
from videodl_logger import videodl_logger
logger = logging.getLogger()
if __name__ == "__main__":
fire.Fire(videodl_logger)
#Updater().update_app()
logger.debug("GUI's startup")
video_dl_gui()
and pack via run sudo pyinstaller -D app.py
and then run binary ./dist/app/app
this time there is no need for sudo
but pack into standalone macOS app still crashes
it seems the confilct between pysimplegui and pyinstaller, and no proper solution found yet.
instead, i have to create setup.py and use pip install way to install this app as a package into my bin directory
here is my setup.py beside app.py
# -*- coding: utf-8 -*-
from pathlib import Path
from setuptools import setup, find_packages
def get_packages(package):
"""
Return root package and all sub-packages.
"""
return [str(path.parent) for path in Path(package).glob("**/__init__.py")]
try:
long_description = open("README.rst").read()
except IOError:
long_description = "Video Downloader"
setup(
name="video-dl",
version="0.11.0",
description="Video Downloader",
long_description=long_description,
license="MIT",
author="Kenshin",
author_email="unknown",
url="https://github.com/Kenshin9977/video-dl",
packages=['', 'utils', 'components_handlers', 'updater'],
package_data={'': ['*.ini', '*.ico', '*.png']},
python_requires='>=3.10',
install_requires=[
'boto3',
'black',
'environs',
'fire',
'flake8',
'gputil',
'mergedeep',
'pillow',
'pyinstaller',
'pynacl',
'pysimplegui',
'quantiphy',
'requests',
'yt-dlp',
],
entry_points={"console_scripts": ["video-dl=gui:main"]},
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
]
)
and input following to the bottom of gui.py
def main():
import __main__
video_dl_gui()
if __name__ == "__main__":
main()
then run python setup.py sdist after that go to dist folder showed up and run pip install video-dl-0.11.0.tar.gz
now i can run package video-dl in any terminal window and run it, not perfect, but better than run python script
build successful on M1 Chip Macbook Pro, but cant open app (icon keep jumping on dock, no app windows shows up)
Everthing fine while building via
sudo python3 MACOS-video-dl.py py2app
but following warnings