ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [ python ] pip install openai Error - UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 1030: illegal multibyte sequence
    Errors 2023. 2. 26. 21:24
    반응형

    오류

    Collecting openai==0.26.1
      Using cached openai-0.26.1.tar.gz (55 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... error
      error: subprocess-exited-with-error

      × Getting requirements to build wheel did not run successfully.
      │ exit code: 1
      ╰─> [21 lines of output]
               Traceback (most recent call last):
                   File "C:\Users\wje07\OneDrive\바탕 화면\develop\python\openai_tutorial\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
                      main()
                   File "C:\Users\wje07\OneDrive\바탕 화면\develop\python\openai_tutorial\env\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 "C:\Users\wje07\OneDrive\바탕 화면\develop\python\openai_tutorial\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
                      return hook(config_settings)
                                ^^^^^^^^^^^^^^^^^^^^^
                   File "C:\Users\wje07\AppData\Local\Temp\pip-build-env-9hc3nwx7\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in get_requires_for_build_wheel
                      return self._get_build_requires(config_settings, requirements=['wheel'])                 
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                   File "C:\Users\wje07\AppData\Local\Temp\pip-build-env-9hc3nwx7\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in _get_build_requires
                       self.run_setup()
                   File "C:\Users\wje07\AppData\Local\Temp\pip-build-env-9hc3nwx7\overlay\Lib\site-packages\setuptools\build_meta.py", line 485, in run_setup
                       self).run_setup(setup_script=setup_script)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                   File "C:\Users\wje07\AppData\Local\Temp\pip-build-env-9hc3nwx7\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
                       exec(code, locals())
                   File "<string>", line 13, in <module>
               UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 1030: 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 wheel 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.

     

      오류 코드에 따르면 cp949 코덱이 잘못된 멀티바이트 시퀀스로 인해 포지션 1030의 바이트 0xe2를 디코드 할 수 없어서 발생하는 문제입니다. 

     

    해결 방법

      찾아본 솔루션으로는 아래 첫 번째 코드를 실행해본 뒤 에러가 해결되지 않으면 두 번째 코드를 실행하는 것이었습니다. 

    set PYTHONUTF8=1
    pip install openai==0.26.1
    set PYTHONIOENCODING=utf-8
    pip install openai==0.26.1

      하지만 해결되지 않아 requirements.txt 에서 해당 내용을 지우고 pip install openai 커맨드를 통해 따로 설치하여 문제를 해결했습니다.

    반응형

    댓글

Designed by Tistory.