nicoboss/nsz

pyinstaller builds for macOS

kailous opened this issue · 15 comments

Now that Ryujinx already supports MacOS, whether it can support cross-platform operation. So that users can build Mac apps themselves.

NSZ is written in Python and fully cross-platform. I see no reason why it wouldn't work on macOS. If you encounter any issues running NSZ on macOS please let me know. There are a lot of macOS and Linux users using NSZ without any issues. I tested NSZ on x64, ARM64 and even on the RISCV64 architecture. So even running it on ARM64 based Apple hardware should be no issue. There are just no portable versions for those operating systems so you have to first install python and then use "pip install nsz" or "pip install nsz[gui]" (if you want the GUI version) to install nsz. NSZ is open-source so feel free to use it if you want to build a macOS application based on it. If you do please let me know so I can promote it to interested users.

I can install and run nsz, but I can't build a MacOS App using py2app. I use py2applet --make-setup nsz.py to regenerate the setup and build it, but on my local machine, it runs fine, but when I send it to others, it will report an error.


Last login: Mon Jan  2 14:51:38 on ttys000
/Users/user/Public/nsz.app/Contents/MacOS/nsz ; exit;                           
user@zhouliandeMacBook-Air ~ % /Users/user/Public/nsz.app/Contents/MacOS/nsz ; exit;
Traceback (most recent call last):
  File "/Users/user/Public/nsz.app/Contents/Resources/__boot__.py", line 89, in _recipes_pil_prescript
    import Image
ModuleNotFoundError: No module named 'Image'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/Public/nsz.app/Contents/Resources/__boot__.py", line 135, in <module>
    _recipes_pil_prescript(['MpoImagePlugin', 'BufrStubImagePlugin', 'WebPImagePlugin', 'BmpImagePlugin', 'FliImagePlugin', 'XVThumbImagePlugin', 'DdsImagePlugin', 'IcoImagePlugin', 'PcxImagePlugin', 'PsdImagePlugin', 'TgaImagePlugin', 'BlpImagePlugin', 'XbmImagePlugin', 'SpiderImagePlugin', 'PdfImagePlugin', 'IcnsImagePlugin', 'ImImagePlugin', 'Jpeg2KImagePlugin', 'PalmImagePlugin', 'FitsStubImagePlugin', 'MicImagePlugin', 'GbrImagePlugin', 'FitsImagePlugin', 'Hdf5StubImagePlugin', 'GribStubImagePlugin', 'GifImagePlugin', 'XpmImagePlugin', 'WmfImagePlugin', 'FpxImagePlugin', 'McIdasImagePlugin', 'MspImagePlugin', 'PpmImagePlugin', 'ImtImagePlugin', 'FtexImagePlugin', 'CurImagePlugin', 'EpsImagePlugin', 'SgiImagePlugin', 'IptcImagePlugin', 'JpegImagePlugin', 'MpegImagePlugin', 'DcxImagePlugin', 'PixarImagePlugin', 'TiffImagePlugin', 'SunImagePlugin', 'PngImagePlugin', 'PcdImagePlugin'])
  File "/Users/user/Public/nsz.app/Contents/Resources/__boot__.py", line 93, in _recipes_pil_prescript
    from PIL import Image
  File "/Users/user/Public/nsz.app/Contents/Resources/lib/python3.9/PIL/Image.py", line 100, in <module>
    from . import _imaging as core
ImportError: dlopen(/Users/user/Public/nsz.app/Contents/Resources/lib/python3.9/PIL/_imaging.cpython-39-darwin.so, 2): no suitable image found.  Did find:
	/Users/user/Public/nsz.app/Contents/Resources/lib/python3.9/PIL/_imaging.cpython-39-darwin.so: mach-o, but wrong architecture
	/Users/user/Public/nsz.app/Contents/Resources/lib/python3.9/PIL/_imaging.cpython-39-darwin.so: mach-o, but wrong architecture
2023-01-02 15:02:44.412 nsz[13945:469164] Launch error
2023-01-02 15:02:44.412 nsz[13945:469164] Launch error
See the py2app website for debugging launch issues
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

use

$HOME/Library/Python/3.9/bin/pyinstaller -F nsz.py

run unix file

Last login: Mon Jan  2 15:37:33 on ttys003
lipeng@kailous-mac ~ % /Users/lipeng/Documents/nsz-mac-master/dist/nsz ; exit;
[INFO   ] [Logger      ] Record log in /Users/lipeng/.kivy/logs/kivy_23-01-02_90.txt
[INFO   ] [Kivy        ] v2.1.0
[INFO   ] [Kivy        ] Installed at "/var/folders/45/3mgr6phx5wj285m4wp7sgkrm0000gn/T/_MEIUAEIpw/kivy/__init__.pyc"
[INFO   ] [Python      ] v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
[INFO   ] [Python      ] Interpreter at "/Users/lipeng/Documents/nsz-mac-master/dist/nsz"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Factory     ] 189 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'2.1 Metal - 83'>
[INFO   ] [GL          ] OpenGL vendor <b'Apple'>
[INFO   ] [GL          ] OpenGL renderer <b'Apple M1'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 1
[INFO   ] [GL          ] Shading version <b'1.20'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Text        ] Provider: sdl2
nut exception: File /private/var/folders/45/3mgr6phx5wj285m4wp7sgkrm0000gn/T/_MEIUAEIpw/nsz/gui/fonts/MPLUS1p-Medium.ttf not found
 Traceback (most recent call last):
   File "nsz.py", line 18, in <module>
   File "nsz/__init__.py", line 81, in main
     def start(win, ctx):
   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
   File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
   File "nsz/gui/NSZ_GUI.py", line 10, in <module>
   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
   File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
   File "nsz/gui/RootWidget.py", line 6, in <module>
   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
   File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
   File "nsz/gui/FileDialogs.py", line 4, in <module>
   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
   File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
   File "kivy/uix/popup.py", line 106, in <module>
   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
   File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
   File "kivy/core/text/__init__.py", line 1016, in <module>
   File "kivy/core/text/__init__.py", line 318, in register
 OSError: File /private/var/folders/45/3mgr6phx5wj285m4wp7sgkrm0000gn/T/_MEIUAEIpw/nsz/gui/fonts/MPLUS1p-Medium.ttf not found
[77652] Failed to execute script 'nsz' due to unhandled exception!

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

Please help me, I'm not a developer, I just want a nsz.app for MacOS.

Having a portable macOS application would be awesome. You almost got it working - you got very far in the startup sequence. Seems like pyinstaller just forgot to pack gui/fonts/MPLUS1p-Medium.ttf. You have to tell pyinstaller that this resource file is required for nsz to work. You can do so by adding it as resource to the data array in your __init__.spec or by specifying it using the --add-data pyinstaller command line argument. NSZ used pyinstaller to pack portable versions a few years ago. Maybe you can use this old __init__.spec as reference: https://github.com/nicoboss/nsz/blob/bbb1b75781152a170608de06369d46bb39d9c129/nsz/__init__.spec. To add MPLUS1p-Medium.ttf just insert ('gui/fonts/MPLUS1p-Medium.ttf', 'gui/fonts/MPLUS1p-Medium.ttf'), between line 9 and 10. If you need any additional help just let me know.

Something else you can do is to remove the custom font:

Config.set("kivy", "default_font", ["MPLUS1p", getGuiPath("fonts/MPLUS1p-Medium.ttf")])

Keep in mind that this is will make the GUI look slightly worse and might lead to visual bugs but it's something you can try if you are unable to add gui/fonts/MPLUS1p-Medium.ttf as resource to pyinstaller.

If you want to do it using py2app you would need to modify setup.py and under install_requires add all the libraries it doesn't find automatically. I recommend to stick with pyinstaller as nsz is proven to be compatible with pyinstaller. So instead, just follow the advice in my last messages.

Last login: Mon Jan  2 16:04:22 on ttys001
lipeng@kailous-mac ~ % cd /Users/lipeng/Documents/nsz-mac-master 
lipeng@kailous-mac nsz-mac-master % /Users/lipeng/Library/Python/3.9/bin/pyinstaller -F nsz.py
82 INFO: PyInstaller: 5.7.0
82 INFO: Python: 3.9.6
92 INFO: Platform: macOS-13.2-arm64-arm-64bit
93 INFO: wrote /Users/lipeng/Documents/nsz-mac-master/nsz.spec
95 INFO: UPX is not available.
95 INFO: Extending PYTHONPATH with paths
['/Users/lipeng/Documents/nsz-mac-master']
187 INFO: checking Analysis
187 INFO: Building Analysis because Analysis-00.toc is non existent
187 INFO: Initializing module dependency graph...
188 INFO: Caching module graph hooks...
194 INFO: Analyzing base_library.zip ...
559 INFO: Loading module hook 'hook-heapq.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
604 INFO: Loading module hook 'hook-encodings.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
1193 INFO: Loading module hook 'hook-pickle.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
1764 INFO: Caching module dependency graph...
1812 INFO: running Analysis Analysis-00.toc
1823 INFO: Analyzing /Users/lipeng/Documents/nsz-mac-master/nsz.py
1841 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
1890 INFO: Loading module hook 'hook-xml.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
2073 INFO: Processing module hooks...
2101 INFO: Looking for ctypes DLLs
2103 INFO: Analyzing run-time hooks ...
2104 INFO: Including run-time hook '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
2106 INFO: Including run-time hook '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
2107 INFO: Including run-time hook '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
2109 INFO: Looking for dynamic libraries
2299 INFO: Looking for eggs
2299 INFO: Using Python library /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/../Python3
2301 INFO: Warnings written to /Users/lipeng/Documents/nsz-mac-master/build/nsz/warn-nsz.txt
2310 INFO: Graph cross-reference written to /Users/lipeng/Documents/nsz-mac-master/build/nsz/xref-nsz.html
2320 INFO: checking PYZ
2320 INFO: Building PYZ because PYZ-00.toc is non existent
2320 INFO: Building PYZ (ZlibArchive) /Users/lipeng/Documents/nsz-mac-master/build/nsz/PYZ-00.pyz
2450 INFO: Building PYZ (ZlibArchive) /Users/lipeng/Documents/nsz-mac-master/build/nsz/PYZ-00.pyz completed successfully.
2452 INFO: EXE target arch: arm64
2452 INFO: Code signing identity: None
2452 INFO: checking PKG
2452 INFO: Building PKG because PKG-00.toc is non existent
2452 INFO: Building PKG (CArchive) nsz.pkg
2718 WARNING: Cannot find path @executable_path/../Python3 (needed by /Library/Developer/CommandLineTools/usr/bin/python3)
3537 INFO: Building PKG (CArchive) nsz.pkg completed successfully.
3538 INFO: Bootloader /Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/bootloader/Darwin-64bit/run
3538 INFO: checking EXE
3538 INFO: Building EXE because EXE-00.toc is non existent
3538 INFO: Building EXE from EXE-00.toc
3538 INFO: Copying bootloader EXE to /Users/lipeng/Documents/nsz-mac-master/dist/nsz
3540 INFO: Converting EXE to target arch (arm64)
3555 INFO: Removing signature(s) from EXE
3568 INFO: Appending PKG archive to EXE
3584 INFO: Fixing EXE headers for code signing
3587 WARNING: Cannot find path @executable_path/../Python3 (needed by /Library/Developer/CommandLineTools/usr/bin/python3)
3589 INFO: Re-signing the EXE
3626 INFO: Building EXE from EXE-00.toc completed successfully.
lipeng@kailous-mac nsz-mac-master % 

Last login: Mon Jan  2 18:39:06 on ttys001
lipeng@kailous-mac ~ % /Users/lipeng/Documents/nsz-mac-master/dist/nsz ; exit;
Traceback (most recent call last):
  File "nsz.py", line 13, in <module>
ModuleNotFoundError: No module named 'nsp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nsz.py", line 17, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
  File "nsz/__init__.py", line 6, in <module>
NameError: name 'Analysis' is not defined
[83545] Failed to execute script 'nsz' due to unhandled exception!

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

Can you please release a MacOS version? I, a layman in development, have been tortured for a day and a night.

Can you please release a MacOS version? I, a layman in development, have been tortured for a day and a night.

Sorry that you had such a bad experience with pyinstaller. I might add official support for pyinstaller again. If I do, I could release pyinstaller builds for Linux/macOS. It should be quite easy to add support for pyinstaller as it’s something nsz had in the past. Maybe I find time to do this in the next few hours.

Thank you and look forward to it.

In my latest commit I added support for pyinstaller. I only tested it on Windows so far. Please get latest commit and execute the PyInstallerBuild.sh script inside the "dev" folder to see if there are still any errors on macOS. The resulting application should be located under nsz\dist_init_ which you have to manually execute (auto-start only works on Windows). Let me know if you encounter any issues. There is probably a lot that can be improved inside init.spec but for now the goal was just to get pyinstaller working again.

Last login: Tue Jan  3 00:18:17 on ttys001
lipeng@kailous-mac ~ % cd /Users/lipeng/Documents/nsz                         
lipeng@kailous-mac nsz % pip3 install -r ./dev/requirements-pyinstaller.txt 
/Users/lipeng/Library/Python/3.9/bin/pyinstaller -F nsz.py ./nsz/__init__.spec 
Defaulting to user installation because normal site-packages is not writeable
Ignoring pywin32: markers 'platform_system == "Windows"' don't match your environment
Ignoring pypiwin32: markers 'platform_system == "Windows"' don't match your environment
Requirement already satisfied: pycryptodome in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from -r ./dev/requirements-pyinstaller.txt (line 1)) (3.16.0)
Requirement already satisfied: zstandard in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from -r ./dev/requirements-pyinstaller.txt (line 2)) (0.19.0)
Requirement already satisfied: enlighten in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from -r ./dev/requirements-pyinstaller.txt (line 3)) (1.11.1)
Requirement already satisfied: kivy in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from -r ./dev/requirements-pyinstaller.txt (line 6)) (2.1.0)
Requirement already satisfied: opencv-python in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from -r ./dev/requirements-pyinstaller.txt (line 7)) (4.7.0.68)
Requirement already satisfied: pyenchant in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from -r ./dev/requirements-pyinstaller.txt (line 8)) (3.2.2)
Requirement already satisfied: pyinstaller in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from -r ./dev/requirements-pyinstaller.txt (line 9)) (5.7.0)
Requirement already satisfied: blessed>=1.17.7 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from enlighten->-r ./dev/requirements-pyinstaller.txt (line 3)) (1.19.1)
Requirement already satisfied: prefixed>=0.3.2 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from enlighten->-r ./dev/requirements-pyinstaller.txt (line 3)) (0.5.0)
Requirement already satisfied: pygments in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from kivy->-r ./dev/requirements-pyinstaller.txt (line 6)) (2.14.0)
Requirement already satisfied: Kivy-Garden>=0.1.4 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from kivy->-r ./dev/requirements-pyinstaller.txt (line 6)) (0.1.5)
Requirement already satisfied: docutils in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from kivy->-r ./dev/requirements-pyinstaller.txt (line 6)) (0.19)
Requirement already satisfied: numpy>=1.17.0 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from opencv-python->-r ./dev/requirements-pyinstaller.txt (line 7)) (1.24.1)
Requirement already satisfied: macholib>=1.8 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from pyinstaller->-r ./dev/requirements-pyinstaller.txt (line 9)) (1.16.2)
Requirement already satisfied: altgraph in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from pyinstaller->-r ./dev/requirements-pyinstaller.txt (line 9)) (0.17.3)
Requirement already satisfied: pyinstaller-hooks-contrib>=2021.4 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from pyinstaller->-r ./dev/requirements-pyinstaller.txt (line 9)) (2022.14)
Requirement already satisfied: setuptools>=42.0.0 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages (from pyinstaller->-r ./dev/requirements-pyinstaller.txt (line 9)) (58.0.4)
Requirement already satisfied: wcwidth>=0.1.4 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from blessed>=1.17.7->enlighten->-r ./dev/requirements-pyinstaller.txt (line 3)) (0.2.5)
Requirement already satisfied: six>=1.9.0 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages (from blessed>=1.17.7->enlighten->-r ./dev/requirements-pyinstaller.txt (line 3)) (1.15.0)
Requirement already satisfied: requests in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from Kivy-Garden>=0.1.4->kivy->-r ./dev/requirements-pyinstaller.txt (line 6)) (2.28.1)
Requirement already satisfied: certifi>=2017.4.17 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from requests->Kivy-Garden>=0.1.4->kivy->-r ./dev/requirements-pyinstaller.txt (line 6)) (2022.12.7)
Requirement already satisfied: idna<4,>=2.5 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from requests->Kivy-Garden>=0.1.4->kivy->-r ./dev/requirements-pyinstaller.txt (line 6)) (3.4)
Requirement already satisfied: charset-normalizer<3,>=2 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from requests->Kivy-Garden>=0.1.4->kivy->-r ./dev/requirements-pyinstaller.txt (line 6)) (2.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/lipeng/Library/Python/3.9/lib/python/site-packages (from requests->Kivy-Garden>=0.1.4->kivy->-r ./dev/requirements-pyinstaller.txt (line 6)) (1.26.13)
46 INFO: PyInstaller: 5.7.0
46 INFO: Python: 3.9.6
52 INFO: Platform: macOS-13.2-arm64-arm-64bit
53 INFO: wrote /Users/lipeng/Documents/nsz/nsz.spec
54 INFO: UPX is not available.
55 INFO: Extending PYTHONPATH with paths
['/Users/lipeng/Documents/nsz', '/Users/lipeng/Documents/nsz']
226 INFO: checking Analysis
226 INFO: Building Analysis because Analysis-00.toc is non existent
226 INFO: Initializing module dependency graph...
227 INFO: Caching module graph hooks...
231 WARNING: Several hooks defined for module 'numpy'. Please take care they do not conflict.
232 INFO: Analyzing base_library.zip ...
514 INFO: Loading module hook 'hook-heapq.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
519 INFO: Loading module hook 'hook-encodings.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
1177 INFO: Loading module hook 'hook-pickle.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
1781 INFO: Caching module dependency graph...
1832 INFO: running Analysis Analysis-00.toc
1841 INFO: Analyzing /Users/lipeng/Documents/nsz/nsz.py
1858 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
1901 INFO: Loading module hook 'hook-xml.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
2126 INFO: Loading module hook 'hook-Crypto.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
2324 INFO: Loading module hook 'hook-platform.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
2553 INFO: Loading module hook 'hook-wcwidth.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
2711 INFO: Loading module hook 'hook-kivy.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
[INFO   ] [Logger      ] Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_7.txt
2718 INFO: Logger: Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_7.txt
[INFO   ] [Kivy        ] v2.1.0
2718 INFO: Kivy: v2.1.0
[INFO   ] [Kivy        ] Installed at "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/__init__.py"
2718 INFO: Kivy: Installed at "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
2718 INFO: Python: v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
[INFO   ] [Python      ] Interpreter at "/Library/Developer/CommandLineTools/usr/bin/python3"
2718 INFO: Python: Interpreter at "/Library/Developer/CommandLineTools/usr/bin/python3"
[INFO   ] [Logger      ] Purge log fired. Processing...
2718 INFO: Logger: Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
2720 INFO: Logger: Purge finished!
[INFO   ] [Factory     ] 189 symbols loaded
2722 INFO: Factory: 189 symbols loaded
[INFO   ] [Logger      ] Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_8.txt
[INFO   ] [Kivy        ] v2.1.0
[INFO   ] [Kivy        ] Installed at "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
[INFO   ] [Python      ] Interpreter at "/Library/Developer/CommandLineTools/usr/bin/python3"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Logger      ] Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_9.txt
21 INFO: Logger: Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_9.txt
[INFO   ] [Kivy        ] v2.1.0
21 INFO: Kivy: v2.1.0
[INFO   ] [Kivy        ] Installed at "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/__init__.py"
21 INFO: Kivy: Installed at "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
21 INFO: Python: v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
[INFO   ] [Python      ] Interpreter at "/Library/Developer/CommandLineTools/usr/bin/python3"
21 INFO: Python: Interpreter at "/Library/Developer/CommandLineTools/usr/bin/python3"
[INFO   ] [Logger      ] Purge log fired. Processing...
21 INFO: Logger: Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
23 INFO: Logger: Purge finished!
[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
51 INFO: Image: Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[WARNING] [Could not find GStreamer plugins. Possible solution] set GST_PLUGIN_PATH
2907 WARNING: Could not find GStreamer plugins. Possible solution: set GST_PLUGIN_PATH
[INFO   ] [Logger      ] Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_10.txt
[INFO   ] [Kivy        ] v2.1.0
[INFO   ] [Kivy        ] Installed at "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
[INFO   ] [Python      ] Interpreter at "/Library/Developer/CommandLineTools/usr/bin/python3"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Logger      ] Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_11.txt
20 INFO: Logger: Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_11.txt
[INFO   ] [Kivy        ] v2.1.0
20 INFO: Kivy: v2.1.0
[INFO   ] [Kivy        ] Installed at "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/__init__.py"
20 INFO: Kivy: Installed at "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
20 INFO: Python: v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
[INFO   ] [Python      ] Interpreter at "/Library/Developer/CommandLineTools/usr/bin/python3"
21 INFO: Python: Interpreter at "/Library/Developer/CommandLineTools/usr/bin/python3"
[INFO   ] [Logger      ] Purge log fired. Processing...
21 INFO: Logger: Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
23 INFO: Logger: Purge finished!
[INFO   ] [Factory     ] 189 symbols loaded
34 INFO: Factory: 189 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
107 INFO: Image: Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] [Window      ] Provider: sdl2
123 INFO: Window: Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
206 INFO: GL: Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
207 INFO: GL: Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'2.1 Metal - 83'>
207 INFO: GL: OpenGL version <b'2.1 Metal - 83'>
[INFO   ] [GL          ] OpenGL vendor <b'Apple'>
207 INFO: GL: OpenGL vendor <b'Apple'>
[INFO   ] [GL          ] OpenGL renderer <b'Apple M1'>
207 INFO: GL: OpenGL renderer <b'Apple M1'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 1
207 INFO: GL: OpenGL parsed version: 2, 1
[INFO   ] [GL          ] Shading version <b'1.20'>
207 INFO: GL: Shading version <b'1.20'>
[INFO   ] [GL          ] Texture max size <16384>
207 INFO: GL: Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
207 INFO: GL: Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
214 INFO: Window: auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
234 INFO: Window: virtual keyboard not allowed, single mode, not docked
[INFO   ] [Video       ] Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)
236 INFO: Video: Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)
[INFO   ] [Text        ] Provider: sdl2
239 INFO: Text: Provider: sdl2
[CRITICAL] [Spelling    ] Unable to find any valuable Spelling provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
enchant - ImportError: The 'enchant' C library was not found and maybe needs to be installed.
See  https://pyenchant.github.io/pyenchant/install.html
for details

  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    mod = importlib.__import__(name='{2}.{0}.{1}'.format(
  File "<frozen importlib._bootstrap>", line 1109, in __import__
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/spelling/spelling_enchant.py", line 12, in <module>
    import enchant
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/enchant/__init__.py", line 81, in <module>
    from enchant import _enchant as _e
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/enchant/_enchant.py", line 157, in <module>
    raise ImportError(msg)

osxappkit - ModuleNotFoundError: No module named 'AppKit'
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    mod = importlib.__import__(name='{2}.{0}.{1}'.format(
  File "<frozen importlib._bootstrap>", line 1109, in __import__
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/spelling/spelling_osxappkit.py", line 16, in <module>
    from AppKit import NSSpellChecker, NSMakeRange

250 CRITICAL: Spelling: Unable to find any valuable Spelling provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
enchant - ImportError: The 'enchant' C library was not found and maybe needs to be installed.
See  https://pyenchant.github.io/pyenchant/install.html
for details

  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    mod = importlib.__import__(name='{2}.{0}.{1}'.format(
  File "<frozen importlib._bootstrap>", line 1109, in __import__
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/spelling/spelling_enchant.py", line 12, in <module>
    import enchant
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/enchant/__init__.py", line 81, in <module>
    from enchant import _enchant as _e
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/enchant/_enchant.py", line 157, in <module>
    raise ImportError(msg)

osxappkit - ModuleNotFoundError: No module named 'AppKit'
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    mod = importlib.__import__(name='{2}.{0}.{1}'.format(
  File "<frozen importlib._bootstrap>", line 1109, in __import__
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/spelling/spelling_osxappkit.py", line 16, in <module>
    from AppKit import NSSpellChecker, NSMakeRange

[INFO   ] [Clipboard   ] Provider: sdl2(['clipboard_nspaste'] ignored)
253 INFO: Clipboard: Provider: sdl2(['clipboard_nspaste'] ignored)
[INFO   ] [Camera      ] Provider: avfoundation
255 INFO: Camera: Provider: avfoundation
[INFO   ] [Audio       ] Providers: audio_sdl2 (audio_ffpyplayer, audio_avplayer ignored)
257 INFO: Audio: Providers: audio_sdl2 (audio_ffpyplayer, audio_avplayer ignored)
3377 INFO: Loading module hook 'hook-sysconfig.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
3384 INFO: Processing pre-find module path hook distutils from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
3388 INFO: Loading module hook 'hook-distutils.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
3800 INFO: Loading module hook 'hook-PIL.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
3834 INFO: Loading module hook 'hook-PIL.Image.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
4064 INFO: Loading module hook 'hook-numpy.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/numpy/_pyinstaller'...
4213 INFO: Loading module hook 'hook-numpy._pytesttester.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
4346 INFO: Loading module hook 'hook-difflib.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
4876 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
5168 INFO: Loading module hook 'hook-certifi.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
5223 INFO: Analyzing /Users/lipeng/Documents/nsz/nsz/__init__.spec
5229 INFO: Loading module hook 'hook-cv2.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
5242 INFO: Loading module hook 'hook-enchant.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/enchant/__init__.py", line 81, in <module>
    from enchant import _enchant as _e
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/enchant/_enchant.py", line 157, in <module>
    raise ImportError(msg)
ImportError: The 'enchant' C library was not found and maybe needs to be installed.
See  https://pyenchant.github.io/pyenchant/install.html
for details

5286 INFO: Processing module hooks...
5418 INFO: Loading module hook 'hook-docutils.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
6074 INFO: Loading module hook 'hook-xml.dom.domreg.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
6223 INFO: Loading module hook 'hook-pygments.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
6646 INFO: Loading module hook 'hook-pkg_resources.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
6996 INFO: Processing pre-safe import module hook gi from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.py'.
7202 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
7330 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
8366 INFO: Processing pre-safe import module hook win32com from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
8401 INFO: Loading module hook 'hook-distutils.util.py' from '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks'...
8521 INFO: Looking for ctypes DLLs
8528 WARNING: Library libmtdev.so.1 required via ctypes not found
8534 INFO: Analyzing run-time hooks ...
8538 INFO: Including run-time hook '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_enchant.py'
8538 INFO: Including run-time hook '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
8539 INFO: Including run-time hook '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
8540 INFO: Including run-time hook '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/rthooks/pyi_rth_kivy.py'
8540 INFO: Including run-time hook '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/rthooks/pyi_rth_gstreamer.py'
8541 INFO: Including run-time hook '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py'
8543 INFO: Including run-time hook '/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
8553 INFO: Looking for dynamic libraries
/Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/building/build_main.py:174: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
  __import__(package)
[INFO   ] [Logger      ] Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_12.txt
204 INFO: Logger: Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_12.txt
[INFO   ] [Kivy        ] v2.1.0
204 INFO: Kivy: v2.1.0
[INFO   ] [Kivy        ] Installed at "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/__init__.py"
205 INFO: Kivy: Installed at "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
205 INFO: Python: v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
[INFO   ] [Python      ] Interpreter at "/Library/Developer/CommandLineTools/usr/bin/python3"
205 INFO: Python: Interpreter at "/Library/Developer/CommandLineTools/usr/bin/python3"
[INFO   ] [Logger      ] Purge log fired. Processing...
205 INFO: Logger: Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
206 INFO: Logger: Purge finished!
[INFO   ] [Factory     ] 189 symbols loaded
213 INFO: Factory: 189 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
282 INFO: Image: Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] [Window      ] Provider: sdl2
294 INFO: Window: Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
383 INFO: GL: Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
383 INFO: GL: Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'2.1 Metal - 83'>
383 INFO: GL: OpenGL version <b'2.1 Metal - 83'>
[INFO   ] [GL          ] OpenGL vendor <b'Apple'>
383 INFO: GL: OpenGL vendor <b'Apple'>
[INFO   ] [GL          ] OpenGL renderer <b'Apple M1'>
383 INFO: GL: OpenGL renderer <b'Apple M1'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 1
383 INFO: GL: OpenGL parsed version: 2, 1
[INFO   ] [GL          ] Shading version <b'1.20'>
383 INFO: GL: Shading version <b'1.20'>
[INFO   ] [GL          ] Texture max size <16384>
383 INFO: GL: Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
384 INFO: GL: Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
393 INFO: Window: auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
413 INFO: Window: virtual keyboard not allowed, single mode, not docked
[INFO   ] [Video       ] Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)
419 INFO: Video: Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)
[INFO   ] [Text        ] Provider: sdl2
426 INFO: Text: Provider: sdl2
[INFO   ] [Audio       ] Providers: audio_sdl2 (audio_ffpyplayer, audio_avplayer ignored)
428 INFO: Audio: Providers: audio_sdl2 (audio_ffpyplayer, audio_avplayer ignored)
objc[3523]: Class CaptureDelegate is implemented in both /Users/lipeng/Library/Python/3.9/lib/python/site-packages/cv2/cv2.abi3.so (0x15327a4d0) and /Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/camera/camera_avfoundation.cpython-39-darwin.so (0x15e4c8b30). One of the two will be used. Which one is undefined.
[INFO   ] [Camera      ] Provider: avfoundation
430 INFO: Camera: Provider: avfoundation
[CRITICAL] [Spelling    ] Unable to find any valuable Spelling provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
enchant - ImportError: The 'enchant' C library was not found and maybe needs to be installed.
See  https://pyenchant.github.io/pyenchant/install.html
for details

  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    mod = importlib.__import__(name='{2}.{0}.{1}'.format(
  File "<frozen importlib._bootstrap>", line 1109, in __import__
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/spelling/spelling_enchant.py", line 12, in <module>
    import enchant
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/enchant/__init__.py", line 81, in <module>
    from enchant import _enchant as _e
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/enchant/_enchant.py", line 157, in <module>
    raise ImportError(msg)

osxappkit - ModuleNotFoundError: No module named 'AppKit'
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    mod = importlib.__import__(name='{2}.{0}.{1}'.format(
  File "<frozen importlib._bootstrap>", line 1109, in __import__
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/spelling/spelling_osxappkit.py", line 16, in <module>
    from AppKit import NSSpellChecker, NSMakeRange

447 CRITICAL: Spelling: Unable to find any valuable Spelling provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
enchant - ImportError: The 'enchant' C library was not found and maybe needs to be installed.
See  https://pyenchant.github.io/pyenchant/install.html
for details

  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    mod = importlib.__import__(name='{2}.{0}.{1}'.format(
  File "<frozen importlib._bootstrap>", line 1109, in __import__
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/spelling/spelling_enchant.py", line 12, in <module>
    import enchant
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/enchant/__init__.py", line 81, in <module>
    from enchant import _enchant as _e
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/enchant/_enchant.py", line 157, in <module>
    raise ImportError(msg)

osxappkit - ModuleNotFoundError: No module named 'AppKit'
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    mod = importlib.__import__(name='{2}.{0}.{1}'.format(
  File "<frozen importlib._bootstrap>", line 1109, in __import__
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/lipeng/Library/Python/3.9/lib/python/site-packages/kivy/core/spelling/spelling_osxappkit.py", line 16, in <module>
    from AppKit import NSSpellChecker, NSMakeRange

[INFO   ] [Clipboard   ] Provider: sdl2(['clipboard_nspaste'] ignored)
469 INFO: Clipboard: Provider: sdl2(['clipboard_nspaste'] ignored)
9366 INFO: Looking for eggs
9366 INFO: Using Python library /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/../Python3
9374 INFO: Warnings written to /Users/lipeng/Documents/nsz/build/nsz/warn-nsz.txt
9411 INFO: Graph cross-reference written to /Users/lipeng/Documents/nsz/build/nsz/xref-nsz.html
9436 INFO: checking PYZ
9436 INFO: Building PYZ because PYZ-00.toc is non existent
9436 INFO: Building PYZ (ZlibArchive) /Users/lipeng/Documents/nsz/build/nsz/PYZ-00.pyz
10082 INFO: Building PYZ (ZlibArchive) /Users/lipeng/Documents/nsz/build/nsz/PYZ-00.pyz completed successfully.
10095 INFO: EXE target arch: arm64
10095 INFO: Code signing identity: None
10096 INFO: checking PKG
10096 INFO: Building PKG because PKG-00.toc is non existent
10096 INFO: Building PKG (CArchive) nsz.pkg
11609 WARNING: Cannot find path @executable_path/../Python3 (needed by /Library/Developer/CommandLineTools/usr/bin/python3)
20481 INFO: Building PKG (CArchive) nsz.pkg completed successfully.
20486 INFO: Bootloader /Users/lipeng/Library/Python/3.9/lib/python/site-packages/PyInstaller/bootloader/Darwin-64bit/run
20486 INFO: checking EXE
20486 INFO: Building EXE because EXE-00.toc is non existent
20486 INFO: Building EXE from EXE-00.toc
20486 INFO: Copying bootloader EXE to /Users/lipeng/Documents/nsz/dist/nsz
20487 INFO: Converting EXE to target arch (arm64)
20498 INFO: Removing signature(s) from EXE
20507 INFO: Appending PKG archive to EXE
20552 INFO: Fixing EXE headers for code signing
20569 WARNING: Cannot find path @executable_path/../Python3 (needed by /Library/Developer/CommandLineTools/usr/bin/python3)
20572 INFO: Re-signing the EXE
20763 INFO: Building EXE from EXE-00.toc completed successfully.
lipeng@kailous-mac nsz % 

run nsz unix file

Last login: Tue Jan  3 00:18:39 on ttys001
lipeng@kailous-mac ~ % /Users/lipeng/Documents/nsz/dist/nsz ; exit;
[INFO   ] [Logger      ] Record log in /Users/lipeng/.kivy/logs/kivy_23-01-03_13.txt
[INFO   ] [Kivy        ] v2.1.0
[INFO   ] [Kivy        ] Installed at "/var/folders/45/3mgr6phx5wj285m4wp7sgkrm0000gn/T/_MEIhqAMnN/kivy/__init__.pyc"
[INFO   ] [Python      ] v3.9.6 (default, Oct 18 2022, 12:41:40) 
[Clang 14.0.0 (clang-1400.0.29.202)]
[INFO   ] [Python      ] Interpreter at "/Users/lipeng/Documents/nsz/dist/nsz"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Factory     ] 189 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'2.1 Metal - 83'>
[INFO   ] [GL          ] OpenGL vendor <b'Apple'>
[INFO   ] [GL          ] OpenGL renderer <b'Apple M1'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 1
[INFO   ] [GL          ] Shading version <b'1.20'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Text        ] Provider: sdl2
nut exception: File /private/var/folders/45/3mgr6phx5wj285m4wp7sgkrm0000gn/T/_MEIhqAMnN/nsz/gui/fonts/MPLUS1p-Medium.ttf not found
 Traceback (most recent call last):
   File "nsz.py", line 18, in <module>
   File "nsz/__init__.py", line 81, in main
     def start(win, ctx):
   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
   File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
   File "nsz/gui/NSZ_GUI.py", line 10, in <module>
   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
   File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
   File "nsz/gui/RootWidget.py", line 6, in <module>
   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
   File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
   File "nsz/gui/FileDialogs.py", line 4, in <module>
   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
   File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
   File "kivy/uix/popup.py", line 106, in <module>
   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
   File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
   File "kivy/core/text/__init__.py", line 1016, in <module>
   File "kivy/core/text/__init__.py", line 318, in register
 OSError: File /private/var/folders/45/3mgr6phx5wj285m4wp7sgkrm0000gn/T/_MEIhqAMnN/nsz/gui/fonts/MPLUS1p-Medium.ttf not found
[3980] Failed to execute script 'nsz' due to unhandled exception!

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[进程已完成]

@kailous you can try building the binary by using the command below. I've successfully built one on my mac.

I think because the default name of binary is nsz and the resource files are also going to be copied to a directory name named nsz/.... So the resources files can not be copied into the correct place under macOS.

/opt/homebrew/bin/pyinstaller \
--add-data "nsz/gui/json/*.json:nsz/gui/json" \
--add-data "nsz/gui/layout/*.kv:nsz/gui/layout" \
--add-data "nsz/gui/shaders/*.shader:nsz/gui/shaders" \
--add-data "nsz/gui/fonts/*:nsz/gui/fonts" \
--add-data "nsz/gui/txt/*.txt:nsz/gui/txt" \
--add-data "nsz/gui/nsZip.png:nsz/gui/nsZip.pn" \
 -F nsz.py -n nszgui

macos: ventura 13.1 (M1)
Successfully installed via the command line. There were problems with the default python (always a problem with a default python)
Python was deleted(don't remember how) and reinstalled via brew (https://docs.brew.sh/Installation#untar-anywhere-unsupported)
brew install python
pip3 install --upgrade nsz

Added keys to $HOME/.switch/

I didn't add nsz to PATH so
/Users/${username}Library/Python/3.9/bin/nsz --help
Works fine. Thank you.