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: 'gbk' codec can't decode byte 0xa4 in position 7599: illegal multibyte sequence #217

Closed
monkeycc opened this issue Aug 14, 2024 · 2 comments · Fixed by #218

Comments

@monkeycc
Copy link

pip install -e .
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Obtaining file:///E:/2023_Code_WEB/segment-anything-2
  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
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "D:\anaconda3\envs\segment-anything-2\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "D:\anaconda3\envs\segment-anything-2\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "D:\anaconda3\envs\segment-anything-2\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 132, in get_requires_for_build_editable
          return hook(config_settings)
        File "C:\Users\mm\AppData\Local\Temp\pip-build-env-rf9w8u_t\overlay\Lib\site-packages\setuptools\build_meta.py", line 458, in get_requires_for_build_editable
          return self.get_requires_for_build_wheel(config_settings)
        File "C:\Users\mm\AppData\Local\Temp\pip-build-env-rf9w8u_t\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "C:\Users\mm\AppData\Local\Temp\pip-build-env-rf9w8u_t\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "C:\Users\mm\AppData\Local\Temp\pip-build-env-rf9w8u_t\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 21, in <module>
      UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 7599: 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.

note: This error originates from a subprocess, and is likely not a problem with pip.
@IUYSY
Copy link

IUYSY commented Aug 14, 2024

setup.py

Read the contents of README file

with open("README.md", encoding='utf-8') as f:

@ronghanghu
Copy link
Contributor

Hi @monkeycc, it seems that the Hugging Face emoji in README.md is causing trouble with gbk codec. It should be fixed in #218.

For now, you can manually replace the line (https://github.com/facebookresearch/segment-anything-2/blob/0db838b11726893f151fa5826ecfa744e1a7760f/setup.py#L20) with

with open("README.md", "r", encoding="utf-8") as f:

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

Successfully merging a pull request may close this issue.

3 participants