LykosAI / StabilityMatrix

Multi-Platform Package Manager for Stable Diffusion
https://lykos.ai
GNU Affero General Public License v3.0
4.81k stars 309 forks source link

Error on Apple Silicon when installing ComfyUI with 2.10.3 #658

Open tanis2000 opened 5 months ago

tanis2000 commented 5 months ago

When I try to install the ComfyUI package the application closes and the error is the following:

Fatal Python error: init_import_site: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
  File "/Volumes/CORSAIR/StabilityMatrix/Assets/Python310/lib/python3.10/site.py", line 617, in <module>
    main()
  File "/Volumes/CORSAIR/StabilityMatrix/Assets/Python310/lib/python3.10/site.py", line 604, in main
    known_paths = addsitepackages(known_paths)
  File "/Volumes/CORSAIR/StabilityMatrix/Assets/Python310/lib/python3.10/site.py", line 387, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "/Volumes/CORSAIR/StabilityMatrix/Assets/Python310/lib/python3.10/site.py", line 226, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "/Volumes/CORSAIR/StabilityMatrix/Assets/Python310/lib/python3.10/site.py", line 179, in addpackage
    for n, line in enumerate(f):
  File "/Volumes/CORSAIR/StabilityMatrix/Assets/Python310/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 37: invalid start byte
tanis2000 commented 5 months ago

An addendum, it looks like this is only happening when using an ExFAT volume for the data

tanis2000 commented 5 months ago

Some more info... it looks like this was an issue with venv and the filest that macOS creates to store the metadata on volumes that do not natively support them. All those files start with "._" and the error you see is that 0xb0 character which is actually the dot character.

It migth have been fixed in one of the Python 3.10.xx versions because I have been able to use venv on that volume with 3.10.14.

I am going to try to replace the one distributed with StabilityMatrix with a copy of my 3.10.14 and see if that makes any difference

ionite34 commented 5 months ago

It seems this was a CPython bug https://github.com/python/cpython/pull/114145 that was fixed first in the 3.10.14 release, we'll look into an update on our end.

tanis2000 commented 5 months ago

yes, that really looks like it. Thanks for looking it up