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

UnicodeDecodeError when trying to build SageAttention #122

Open
gzzhongqi opened this issue Feb 27, 2025 · 8 comments
Open

UnicodeDecodeError when trying to build SageAttention #122

gzzhongqi opened this issue Feb 27, 2025 · 8 comments

Comments

@gzzhongqi
Copy link

gzzhongqi commented Feb 27, 2025

I try to install sageattention for comfyui but I keep getting the following UnicodeDecodeError. I tried looking up online but couldn't find any relevant info. I have a 3090 with cuda 12.4+pytorch 2.5.1. Thanks so much for all your hardwork!

PS F:\sd\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\SageAttention> ..\python_embeded\python.exe -m pip install -e .
Obtaining file:///F:/sd/ComfyUI_windows_portable_nvidia/ComfyUI_windows_portable/SageAttention
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... error
  error: subprocess-exited-with-error

  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      Detect GPUs with compute capabilities: {'8.6'}
      Traceback (most recent call last):
        File "F:\sd\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
          main()
        File "F:\sd\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "F:\sd\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 157, in get_requires_for_build_editable
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "F:\sd\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\setuptools\build_meta.py", line 482, in get_requires_for_build_editable
          return self.get_requires_for_build_wheel(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "F:\sd\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\setuptools\build_meta.py", line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "F:\sd\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\setuptools\build_meta.py", line 303, in _get_build_requires
          self.run_setup()
        File "F:\sd\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\setuptools\build_meta.py", line 521, in run_setup
          super().run_setup(setup_script=setup_script)
        File "F:\sd\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\setuptools\build_meta.py", line 319, in run_setup
          exec(code, locals())
        File "<string>", line 181, in <module>
      UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 1612: illegal multibyte sequence
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build editable did not run successfully.
│ exit code: 1
╰─> See above for output.
@Sampkao
Copy link

Sampkao commented Feb 28, 2025

Same problem. It seems that the latest version of the code has a little error. I temporarily installed it successfully using another older fork.

@jason-huang03
Copy link
Member

We will try to reproduce the problem on 3090.

@Sampkao
Copy link

Sampkao commented Feb 28, 2025

Thanks for your hard work. My OS is Traditional Chinese and the error message is "cp950 codec can't decode..." but not "gbk". It seems to have something to do with the language of the OS?

@gzzhongqi
Copy link
Author

gzzhongqi commented Feb 28, 2025

I found a fix. I turned on "use unicode utf-8 for worldwide language support" in windows and the error is gone. I guess the error has something to do with the code not handling non-unicode system language packs

@tvsj
Copy link

tvsj commented Feb 28, 2025

Image
中文版解决方案

@ashllay
Copy link

ashllay commented Mar 1, 2025

Comment line 181 on ".\SageAttention\setup.py"

ref: #98

@Sampkao
Copy link

Sampkao commented Mar 1, 2025

Status update: problem fixed when I turned on "use unicode utf-8 for worldwide language support", thank all you guys!

@dylanchou
Copy link

change the setup.py

long_description=open('README.md').read(),

after#

long_description=open('README.md', encoding='utf-8').read(),

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

No branches or pull requests

6 participants