Safe-and-Stable-Ckpt2Safetensors-Conversion-Tool-GUI icon indicating copy to clipboard operation
Safe-and-Stable-Ckpt2Safetensors-Conversion-Tool-GUI copied to clipboard

Failed to run on macos

Open songkeys opened this issue 1 year ago • 4 comments

environment: macos m1 python 3.9

python3 run_app_gui.py
/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py:24845: UserWarning: You are running a VERY old version of tkinter 8.5.9. You cannot use PNG formatted images for example.  Please upgrade to 8.6.x
  warnings.warn('You are running a VERY old version of tkinter {}. You cannot use PNG formatted images for example.  Please upgrade to 8.6.x'.format(tclversion_detailed), UserWarning)
Mac OS Version is 13.2 and patch enabled so applying the patch
Applyting Mac OS 12.3+ Alpha Channel fix.  Your default Alpha Channel is now 0.99
DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
Traceback (most recent call last):
  File "/Users/songkeys/Downloads/convertor/run_app_gui.py", line 309, in <module>
    main()
  File "/Users/songkeys/Downloads/convertor/run_app_gui.py", line 93, in main
    window = sg.Window(APP_TITLE,layout,finalize=True, resizable=True,enable_close_attempted_event=False,background_color=color.GRAY_9900)
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 9614, in __init__
    self.Finalize()
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 10300, in finalize
    self.Read(timeout=1)
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 10075, in read
    results = self._read(timeout=timeout, timeout_key=timeout_key)
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 10146, in _read
    self._Show()
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 9886, in _Show
    StartupTK(self)
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 16866, in StartupTK
    _convert_window_to_tk(window)
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 16753, in _convert_window_to_tk
    PackFormIntoFrame(window, master, window)
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 15991, in PackFormIntoFrame
    PackFormIntoFrame(element, labeled_frame, toplevel_form)
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 15991, in PackFormIntoFrame
    PackFormIntoFrame(element, labeled_frame, toplevel_form)
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 15216, in PackFormIntoFrame
    photo = tk.PhotoImage(data=element.ImageData)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 4064, in __init__
    Image.__init__(self, 'photo', name, cnf, master, **kw)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 4009, in __init__
    self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't recognize image data

I tried python3.9 run_app_gui.py, it's another error:

python3.9 run_app_gui.py
Traceback (most recent call last):
  File "/Users/songkeys/Downloads/convertor/run_app_gui.py", line 1, in <module>
    import PySimpleGUI as sg
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/__init__.py", line 2, in <module>
    from .PySimpleGUI import *
  File "/Users/songkeys/Library/Python/3.9/lib/python/site-packages/PySimpleGUI/PySimpleGUI.py", line 136, in <module>
    import tkinter as tk
  File "/opt/homebrew/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 37, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

I have run both pip install -r requirements.txt and pip3 install -r requirements.txt.

songkeys avatar Mar 06 '23 10:03 songkeys

I was able to get this by doing brew install python-tk

benbernard avatar May 01 '23 22:05 benbernard

After installing the necessary dependencies I just ran this on mac 12.6

Open terminal, Cd into the folder, then python3 "filename", after a few seconds the GUI popped up.

Filthy420 avatar Aug 22 '23 18:08 Filthy420

this is the error I am getting on MacOS Sequoia 15, M3. "numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject" going to try to see if I can find the numpy version it needs, assuming it is being imported by pandas?

danibarker avatar Sep 23 '24 03:09 danibarker

On MacOS 15, M3, Not sure which of the changes I made got it to work, but I switched to Python3.10.5 and this is my requirements.txt file:

torch pytorch-lightning==1.8.3.post1 torchsde==0.2.5 safetensors==0.2.5 pysimplegui==4.60.5 numpy<=1.26.4 pandas==1.3.5

nothing else was working, so the changes I made to this file may or may not be required

(UPDATE: it did actually start up, but converting is not working :(

Exception in thread Thread-2 (process_file): Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/Users/redacted/programming/personal/Safe-and-Stable-Ckpt2Safetensors-Conversion-Tool-GUI/run_app_gui.py", line 120, in process_file convert_to_st(file_path,suffix) File "/Users/redacted/programming/personal/Safe-and-Stable-Ckpt2Safetensors-Conversion-Tool-GUI/run_app_gui.py", line 169, in convert_to_st save_file(weights, file_name) File "/Users/redacted/Library/Python/3.10/lib/python/site-packages/safetensors/torch.py", line 71, in save_file serialize_file(_flatten(tensors), filename, metadata=metadata) File "/Users/redacted/Library/Python/3.10/lib/python/site-packages/safetensors/torch.py", line 217, in _flatten raise ValueError(f"Expected a dict of [str, torch.Tensor] but received {type(tensors)}") ValueError: Expected a dict of [str, torch.Tensor] but received <class 'NoneType'>

danibarker avatar Sep 23 '24 03:09 danibarker