Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled app fails on OSX #270

Open
dev-kang opened this issue Jun 4, 2022 · 8 comments
Open

Compiled app fails on OSX #270

dev-kang opened this issue Jun 4, 2022 · 8 comments

Comments

@dev-kang
Copy link

dev-kang commented Jun 4, 2022

Bug/Issue Description:
when I run compile file , It run normal, but It show this error.

image
Required Information:
Provide the following information to assist with reporting the bug:

  1. Provide a full copy of the command line options you are using, for example:

pyinstaller command

pyinstaller scenedetect.spec

run compile file command

./dist/scenedetect/scenedetect

  1. Add -v debug -l BUG_REPORT.txt to the beginning of the command, then re-run PySceneDetect and attach the generated BUG_REPORT.txt file.

Expected Behavior:
A clear and concise description of what you expected to happen.

Computing Environment:

  • OS: OSX
  • Python Version: 3.9.10
  • OpenCV Version:4.5.5
  • Pyinstaller Version: 5.0.1

Additional Information:
image

Media [Videos/Images/Screenshots]:
Provide any other information you can, including videos/media that can demonstrate the bug you are reporting (even YouTube links are fine). If applicable, add the output images from PySceneDetect, or any screenshots you feel are necessary to help explain your problem.

Remove this section if there is no media associated with the issue/bug report.

@Breakthrough
Copy link
Owner

Breakthrough commented Jun 4, 2022

Unfortunately I don't have any OSX machines to test/develop on, so I'll need some assistance with debugging this one. Are you able to run scenedetect if you install the package (either via pip or python -m build)?

Can you try using PyInstaller 4.10? (python -m pip install pyinstaller==4.10) This is the current version I'm using to build the Windows app.

Thanks!


Edit: I just tried using both PyInstaller 5.0.1 and the latest (5.1) on Ubuntu 20.04 with Python 3.8 and it seemed to work correctly. Are there any errors in the output of running pyinstaller scenedetect.spec? Could you try running from the root of the repo, e.g. pyinstaller dist/scenedetect.spec?

I found a similar sounding bug in BEEmod/BEE2.4#1585 on Ubuntu, but the outcome was inconclusive.

@Breakthrough Breakthrough changed the title The compiled file runs exception Compiled app fails on OSX Jun 4, 2022
@dev-kang
Copy link
Author

dev-kang commented Jun 5, 2022

Unfortunately I don't have any OSX machines to test/develop on, so I'll need some assistance with debugging this one. Are you able to run scenedetect if you install the package (either via pip or python -m build)?

Can you try using PyInstaller 4.10? (python -m pip install pyinstaller==4.10) This is the current version I'm using to build the Windows app.

Thanks!

Edit: I just tried using both PyInstaller 5.0.1 and the latest (5.1) on Ubuntu 20.04 with Python 3.8 and it seemed to work correctly. Are there any errors in the output of running pyinstaller scenedetect.spec? Could you try running from the root of the repo, e.g. pyinstaller dist/scenedetect.spec?

I found a similar sounding bug in BEEmod/BEE2.4#1585 on Ubuntu, but the outcome was inconclusive.

Hi, I'm very sorry I'm leading in the mistake, I compiled successfully, and I can run the executable file normal, But when I run the file in the command , it always show this message

image

and I found that there is always such a child process in the system process, the child process has been suspended and restarted, and I can't kill it . It always exist.

image

I also run python scenedetect.py, it's corrected. and I use 'python setup.py install', it also normal.

@dev-kang
Copy link
Author

dev-kang commented Jun 5, 2022

the pyinstaller compile log is here, I hope it can help you

(venv) ➜  ~/workspace/PySceneDetect git:(master) ✗ pyinstaller -v              
5.0.1
(venv) ➜  ~/workspace/PySceneDetect git:(master) ✗ pyinstaller scenedetect.spec
169 INFO: PyInstaller: 5.0.1
169 INFO: Python: 3.9.10
183 INFO: Platform: macOS-11.6-x86_64-i386-64bit
189 INFO: UPX is not available.
191 INFO: Extending PYTHONPATH with paths
['/workspace/PySceneDetect',
 '/workspace/PySceneDetect']
486 INFO: checking Analysis
487 INFO: Building Analysis because Analysis-00.toc is non existent
487 INFO: Initializing module dependency graph...
497 INFO: Caching module graph hooks...
508 INFO: Analyzing base_library.zip ...
2863 INFO: Processing pre-find module path hook distutils from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
2980 INFO: distutils: retargeting to non-venv dir '/usr/local/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9'
6105 INFO: Caching module dependency graph...
6253 INFO: running Analysis Analysis-00.toc
6261 INFO: Analyzing scenedetect/__main__.py
9518 INFO: Processing pre-find module path hook site from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'.
9518 INFO: site: retargeting to fake-dir '/usr/local/lib/python3.9/site-packages/PyInstaller/fake-modules'
12417 INFO: Processing module hooks...
12417 INFO: Loading module hook 'hook-py.py' from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
12962 INFO: Loading module hook 'hook-cv2.py' from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
12966 INFO: Loading module hook 'hook-pytest.py' from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
13197 INFO: Loading module hook 'hook-pkg_resources.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
99 WARNING: Failed to collect submodules for 'pkg_resources._vendor.pyparsing.diagram' because importing 'pkg_resources._vendor.pyparsing.diagram' raised: ModuleNotFoundError: No module named 'railroad'
13971 INFO: Processing pre-safe import module hook win32com from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
14596 WARNING: Hidden import "pkg_resources.py2_warn" not found!
14597 WARNING: Hidden import "pkg_resources.markers" not found!
14601 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
14602 INFO: Loading module hook 'hook-lib2to3.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
14620 INFO: Loading module hook 'hook-encodings.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
14697 INFO: Loading module hook 'hook-distutils.util.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
14703 INFO: Loading module hook 'hook-setuptools.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
164 WARNING: Failed to collect submodules for 'setuptools._vendor.pyparsing.diagram' because importing 'setuptools._vendor.pyparsing.diagram' raised: ModuleNotFoundError: No module named 'railroad'
16325 INFO: Loading module hook 'hook-xml.dom.domreg.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16326 INFO: Loading module hook 'hook-packaging.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16327 INFO: Loading module hook 'hook-pickle.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16330 INFO: Loading module hook 'hook-heapq.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16333 INFO: Loading module hook 'hook-difflib.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16336 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16339 INFO: Loading module hook 'hook-sysconfig.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16347 INFO: Loading module hook 'hook-xml.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16347 INFO: Loading module hook 'hook-numpy.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16407 INFO: Import to be excluded not found: 'f2py'
16407 INFO: Loading module hook 'hook-distutils.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16410 INFO: Loading module hook 'hook-numpy._pytesttester.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16413 INFO: Loading module hook 'hook-setuptools.msvc.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
16442 INFO: Looking for ctypes DLLs
16495 INFO: Analyzing run-time hooks ...
16499 INFO: Including run-time hook '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_subprocess.py'
16503 INFO: Including run-time hook '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
16507 INFO: Including run-time hook '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
16510 INFO: Including run-time hook '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
16521 INFO: Looking for dynamic libraries
/usr/local/lib/python3.9/site-packages/PyInstaller/building/build_main.py:156: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
  __import__(package)
17548 INFO: Looking for eggs
17548 INFO: Using Python library /usr/local/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/Python
17560 INFO: Warnings written to /workspace/PySceneDetect/build/scenedetect/warn-scenedetect.txt
17620 INFO: Graph cross-reference written to /workspace/PySceneDetect/build/scenedetect/xref-scenedetect.html
17635 INFO: Appending 'datas' from .spec
17640 INFO: checking PYZ
17640 INFO: Building PYZ because PYZ-00.toc is non existent
17640 INFO: Building PYZ (ZlibArchive) /workspace/PySceneDetect/build/scenedetect/PYZ-00.pyz
18415 INFO: Building PYZ (ZlibArchive) /workspace/PySceneDetect/build/scenedetect/PYZ-00.pyz completed successfully.
18427 INFO: EXE target arch: x86_64
18427 INFO: Code signing identity: None
18427 INFO: checking PKG
18427 INFO: Building PKG because PKG-00.toc is non existent
18427 INFO: Building PKG (CArchive) scenedetect.pkg
18441 INFO: Building PKG (CArchive) scenedetect.pkg completed successfully.
18442 INFO: Bootloader /usr/local/lib/python3.9/site-packages/PyInstaller/bootloader/Darwin-64bit/run
18442 INFO: checking EXE
18442 INFO: Building EXE because EXE-00.toc is non existent
18442 INFO: Building EXE from EXE-00.toc
18442 INFO: Copying bootloader EXE to /workspace/PySceneDetect/build/scenedetect/scenedetect
18443 INFO: Converting EXE to target arch (x86_64)
18467 INFO: Removing signature(s) from EXE
18506 INFO: Appending PKG archive to EXE
18510 INFO: Fixing EXE headers for code signing
18521 INFO: Re-signing the EXE
18579 INFO: Building EXE from EXE-00.toc completed successfully.
18583 INFO: checking COLLECT
18583 INFO: Building COLLECT because COLLECT-00.toc is non existent
18583 INFO: Building COLLECT COLLECT-00.toc
20908 INFO: Building COLLECT COLLECT-00.toc completed successfully.

@dev-kang
Copy link
Author

dev-kang commented Jun 5, 2022

When I use the pyinstall in the version 4.10. It compile successfully, But I run the executable file, it show nothing .

This is the compile log and run log .

(venv) ➜  ~/workspace/PySceneDetect git:(master) ✗ pyinstaller -v
4.10
(venv) ➜  ~/workspace/PySceneDetect git:(master) ✗ pyinstaller scenedetect.py 
116 INFO: PyInstaller: 4.10
117 INFO: Python: 3.9.10
130 INFO: Platform: macOS-11.6-x86_64-i386-64bit
132 INFO: wrote ~/workspace/PySceneDetect/scenedetect.spec
136 INFO: UPX is not available.
139 INFO: Extending PYTHONPATH with paths
['~/workspace/PySceneDetect']
312 INFO: checking Analysis
312 INFO: Building Analysis because Analysis-00.toc is non existent
312 INFO: Initializing module dependency graph...
316 INFO: Caching module graph hooks...
324 INFO: Analyzing base_library.zip ...
2591 INFO: Processing pre-find module path hook distutils from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
2655 INFO: distutils: retargeting to non-venv dir '/usr/local/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9'
5511 INFO: Caching module dependency graph...
5657 INFO: running Analysis Analysis-00.toc
5666 INFO: Analyzing ~/workspace/PySceneDetect/scenedetect.py
7940 INFO: Processing pre-find module path hook site from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'.
7940 INFO: site: retargeting to fake-dir '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/fake-modules'
10506 INFO: Processing module hooks...
10506 INFO: Loading module hook 'hook-py.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
10886 INFO: Loading module hook 'hook-cv2.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
10890 INFO: Loading module hook 'hook-pytest.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
11093 INFO: Loading module hook 'hook-pkg_resources.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
11417 INFO: Processing pre-safe import module hook win32com from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
11572 WARNING: Hidden import "pkg_resources.py2_warn" not found!
11573 WARNING: Hidden import "pkg_resources.markers" not found!
11577 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
11578 INFO: Loading module hook 'hook-lib2to3.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
11599 INFO: Loading module hook 'hook-encodings.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
11675 INFO: Loading module hook 'hook-distutils.util.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
11682 INFO: Loading module hook 'hook-setuptools.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12258 INFO: Loading module hook 'hook-xml.dom.domreg.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12264 INFO: Loading module hook 'hook-packaging.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12265 INFO: Loading module hook 'hook-pickle.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12269 INFO: Loading module hook 'hook-heapq.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12272 INFO: Loading module hook 'hook-difflib.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12275 INFO: Loading module hook 'hook-multiprocessing.util.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12278 INFO: Loading module hook 'hook-sysconfig.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12286 INFO: Loading module hook 'hook-xml.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12287 INFO: Loading module hook 'hook-numpy.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12341 INFO: Import to be excluded not found: 'f2py'
12359 INFO: Loading module hook 'hook-distutils.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12359 INFO: Loading module hook 'hook-numpy._pytesttester.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12362 INFO: Loading module hook 'hook-setuptools.msvc.py' from '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks'...
12389 INFO: Looking for ctypes DLLs
12443 INFO: Analyzing run-time hooks ...
12447 INFO: Including run-time hook '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_subprocess.py'
12448 INFO: Including run-time hook '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
12450 INFO: Including run-time hook '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
12453 INFO: Including run-time hook '~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
12462 INFO: Looking for dynamic libraries
13168 INFO: Looking for eggs
13168 INFO: Using Python library /usr/local/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/Python
13175 INFO: Warnings written to ~/workspace/PySceneDetect/build/scenedetect/warn-scenedetect.txt
13229 INFO: Graph cross-reference written to ~/workspace/PySceneDetect/build/scenedetect/xref-scenedetect.html
13255 INFO: checking PYZ
13256 INFO: Building PYZ because PYZ-00.toc is non existent
13256 INFO: Building PYZ (ZlibArchive) ~/workspace/PySceneDetect/build/scenedetect/PYZ-00.pyz
13894 INFO: Building PYZ (ZlibArchive) ~/workspace/PySceneDetect/build/scenedetect/PYZ-00.pyz completed successfully.
13910 INFO: EXE target arch: x86_64
13910 INFO: Code signing identity: None
13910 INFO: checking PKG
13910 INFO: Building PKG because PKG-00.toc is non existent
13910 INFO: Building PKG (CArchive) scenedetect.pkg
13933 INFO: Building PKG (CArchive) scenedetect.pkg completed successfully.
13934 INFO: Bootloader ~/workspace/PySceneDetect/venv/lib/python3.9/site-packages/PyInstaller/bootloader/Darwin-64bit/run
13934 INFO: checking EXE
13934 INFO: Building EXE because EXE-00.toc is non existent
13934 INFO: Building EXE from EXE-00.toc
13934 INFO: Copying bootloader EXE to ~/workspace/PySceneDetect/build/scenedetect/scenedetect
13935 INFO: Converting EXE to target arch (x86_64)
13970 INFO: Removing signature(s) from EXE
14017 INFO: Appending PKG archive to EXE
14020 INFO: Fixing EXE headers for code signing
14033 INFO: Re-signing the EXE
14096 INFO: Building EXE from EXE-00.toc completed successfully.
14100 INFO: checking COLLECT
14100 INFO: Building COLLECT because COLLECT-00.toc is non existent
14100 INFO: Building COLLECT COLLECT-00.toc
16510 INFO: Building COLLECT COLLECT-00.toc completed successfully.
(venv) ➜  ~/workspace/PySceneDetect git:(master) ✗ ./dist/scenedetect/scenedetect
(venv) ➜  ~/workspace/PySceneDetect git:(master) ✗ ./dist/scenedetect/scenedetect -h 
(venv) ➜  ~/workspace/PySceneDetect git:(master) ✗ ./dist/scenedetect/scenedetect -h 
(venv) ➜  ~/workspace/PySceneDetect git:(master) ✗ 

@Breakthrough
Copy link
Owner

I noticed you used the command pyinstaller scenedetect.py in your last comment, you need to make sure to use the .spec file for the app to work correctly. I don't see any issues in the PyInstaller logs, but can you retry with PyInstaller 4.10 and the .spec file? It would be useful to know if the issue only happens with PyInstaller 5.x or happens on all versions.

Thanks for bringing this up, I'm sorry I can't be more help in debugging the problem. For now I will mark this as a known issue, and hopefully someone on OSX more familiar with PyInstaller might be able to help out more.

@9SL9
Copy link

9SL9 commented Jul 29, 2022

My first time doing any of this. Hope this helps @Breakthrough

What I would like to get is a single file I can include in an Xcode project to call scenedetect. Will this process do it for me?

Here's the log using PyInstaller 4.10:


pyinstaller scenedetect.spec
49 INFO: PyInstaller: 4.10
49 INFO: Python: 3.9.12
59 INFO: Platform: macOS-12.5-arm64-arm-64bit
61 INFO: UPX is not available.
62 INFO: Extending PYTHONPATH with paths
['/Users/x/Downloads/PySceneDetect-master-2',
'/Users/x/Downloads/PySceneDetect-master-2/dist']
132 INFO: checking Analysis
132 INFO: Building Analysis because Analysis-00.toc is non existent
132 INFO: Initializing module dependency graph...
134 INFO: Caching module graph hooks...
138 INFO: Analyzing base_library.zip ...
1317 INFO: Processing pre-find module path hook distutils from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
1344 INFO: distutils: retargeting to non-venv dir '/opt/homebrew/Cellar/[email protected]/3.9.12_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9'
2233 INFO: Caching module dependency graph...
2297 INFO: running Analysis Analysis-00.toc
2302 INFO: Analyzing ../scenedetect/main.py
2688 INFO: Processing pre-find module path hook site from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'.
2689 INFO: site: retargeting to fake-dir '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/fake-modules'
3796 INFO: Processing pre-safe import module hook win32com from '/opt/homebrew/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
3809 INFO: Processing module hooks...
3809 INFO: Loading module hook 'hook-appdirs.py' from '/opt/homebrew/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
3810 INFO: Loading module hook 'hook-cv2.py' from '/opt/homebrew/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
3811 INFO: Loading module hook 'hook-pkg_resources.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4046 WARNING: Hidden import "pkg_resources.py2_warn" not found!
4046 WARNING: Hidden import "pkg_resources.markers" not found!
4047 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4048 INFO: Loading module hook 'hook-lib2to3.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4056 INFO: Loading module hook 'hook-encodings.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4082 INFO: Loading module hook 'hook-distutils.util.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4084 INFO: Loading module hook 'hook-setuptools.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4401 INFO: Loading module hook 'hook-pickle.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4402 INFO: Loading module hook 'hook-heapq.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4403 INFO: Loading module hook 'hook-difflib.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4404 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4405 INFO: Loading module hook 'hook-sysconfig.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4409 INFO: Loading module hook 'hook-xml.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4426 INFO: Loading module hook 'hook-numpy.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4443 INFO: Import to be excluded not found: 'f2py'
4453 INFO: Loading module hook 'hook-distutils.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4453 INFO: Loading module hook 'hook-numpy._pytesttester.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4454 INFO: Loading module hook 'hook-setuptools.msvc.py' from '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks'...
4466 INFO: Looking for ctypes DLLs
4488 INFO: Analyzing run-time hooks ...
4491 INFO: Including run-time hook '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_subprocess.py'
4491 INFO: Including run-time hook '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
4492 INFO: Including run-time hook '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
4493 INFO: Including run-time hook '/opt/homebrew/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
4497 INFO: Looking for dynamic libraries
4635 INFO: Looking for eggs
4635 INFO: Using Python library /opt/homebrew/Cellar/[email protected]/3.9.12_1/Frameworks/Python.framework/Versions/3.9/Python
4639 INFO: Warnings written to /Users/x/Downloads/PySceneDetect-master-2/dist/build/scenedetect/warn-scenedetect.txt
4660 INFO: Graph cross-reference written to /Users/x/Downloads/PySceneDetect-master-2/dist/build/scenedetect/xref-scenedetect.html
4668 INFO: Appending 'datas' from .spec
4672 INFO: checking PYZ
4672 INFO: Building PYZ because PYZ-00.toc is non existent
4672 INFO: Building PYZ (ZlibArchive) /Users/x/Downloads/PySceneDetect-master-2/dist/build/scenedetect/PYZ-00.pyz
5029 INFO: Building PYZ (ZlibArchive) /Users/x/Downloads/PySceneDetect-master-2/dist/build/scenedetect/PYZ-00.pyz completed successfully.
5034 INFO: EXE target arch: arm64
5034 INFO: Code signing identity: None
5035 INFO: checking PKG
5035 INFO: Building PKG because PKG-00.toc is non existent
5035 INFO: Building PKG (CArchive) scenedetect.pkg
5041 INFO: Building PKG (CArchive) scenedetect.pkg completed successfully.
5042 INFO: Bootloader /opt/homebrew/lib/python3.9/site-packages/PyInstaller/bootloader/Darwin-64bit/run
5042 INFO: checking EXE
5042 INFO: Building EXE because EXE-00.toc is non existent
5042 INFO: Building EXE from EXE-00.toc
5042 INFO: Copying bootloader EXE to /Users/x/Downloads/PySceneDetect-master-2/dist/build/scenedetect/scenedetect
5044 INFO: Converting EXE to target arch (arm64)
6459 INFO: Removing signature(s) from EXE
6473 INFO: Appending PKG archive to EXE
6474 INFO: Fixing EXE headers for code signing
6478 INFO: Re-signing the EXE
6492 INFO: Building EXE from EXE-00.toc completed successfully.
6494 INFO: checking COLLECT
6494 INFO: Building COLLECT because COLLECT-00.toc is non existent
6494 INFO: Building COLLECT COLLECT-00.toc
8963 INFO: Building COLLECT COLLECT-00.toc completed successfully.

@9SL9
Copy link

9SL9 commented Jul 29, 2022

I'm hoping to build a single file scenedetect that contains everything needed to run to embed in my Xcode project. Including all dependencies such as CV, Numpy etc etc. I'm very new to python and all the tools such as pyinstaller. Are you able to provide any advice/point me in the right direction?

Thanks in advance.

@Breakthrough
Copy link
Owner

Breakthrough commented Jul 31, 2022

@9SL9 All you need to do is run pyinstaller dist/scenedetect.spec from the root of the project source, so it looks like you did the right thing. What do you see as the output when you run the compiled file?

I'm far from a PyInstaller expert myself, nor do I have access to any OSX machines, so I'm hoping someone might be able to help out with this. Specifically, figuring out what versions of PyInstaller / OpenCV work correctly when building the app on OSX. The command above is exactly how the Windows distributions are built, and I have tested the process under Linux as well. It should also work with a newer version of PyInstaller and OpenCV, the versions the project is pinned to are mainly to ensure build stability across the supported version matrix (sometimes the PyInstaller hooks need to be updated when new OpenCV versions are released, which requires using an older version of PyInstaller and/or OpenCV temporarily).

It might be worth creating a new .spec file and seeing what differs between the existing one and a new one created under OSX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants