pip install labelme
아나콘다를 통해 위 명령어로 설치하는 도중에
(anomalib_env) C:\WINDOWS\system32>pip install labelme Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com Collecting labelme Downloading labelme-5.3.1.tar.gz (1.5 MB) ---------------------------------------- 1.5/1.5 MB 15.5 MB/s eta 0:00:00 Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [10 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "C:\Users\LEE CHANG YOUNG\AppData\Local\Temp\pip-install-y4b20jg0\labelme_111a18c52ad845bf9fca91aa6fd08208\setup.py", line 162, in main() File "C:\Users\LEE CHANG YOUNG\AppData\Local\Temp\pip-install-y4b20jg0\labelme_111a18c52ad845bf9fca91aa6fd08208\setup.py", line 125, in main long_description=get_long_description(), File "C:\Users\AppData\Local\Temp\pip-install-y4b20jg0\labelme_111a18c52ad845bf9fca91aa6fd08208\setup.py", line 75, in get_long_description long_description = f.read() UnicodeDecodeError: 'cp949' codec can't decode byte 0xf0 in position 3647: illegal multibyte sequence [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
이 에러가 발생했다.
해당 에러는 'labelme' 패키지를 설치하려 할 때 발생한 'UnicodeDecoderError'와 관련된 것이다.
에러 메시지를 자세히 살펴보면 'cp949'코덱이 특정 바이트를 디코딩할수 없다는 내용인 것을 확인할 수 있다.
'cp949'는 한글 윈도우에서 사용하는 문자 인코딩 방식이다.
이 문제는 'labelme'의 'setup.py'파일이 특정 인코딩으로 읽혀서 발생한 것으로 추측된다.
내가 해결한 방법은 다음과 같다.
우선 anaconda prompt에서 아래 명령어로 setup.py파일을 notepad에서 열어준다.
notepad setup.py
def get_long_description():
with open("README.md") as f:
long_description = f.read()
try:
# when this package is being released
import github2pypi
return github2pypi.replace_url(
slug="wkentaro/labelme", content=long_description, branch="main"
)
except ImportError:
# when this package is being installed
return long_description
이 함수 부분에서 에러가 발생한 것인데, 위 코드를 아래와같이 수정해주면 된다.
def get_long_description():
with open("README.md", 'r', encoding='utf-8') as f: # 수정된 부분
long_description = f.read()
try:
# when this package is being released
import github2pypi
return github2pypi.replace_url(
slug="wkentaro/labelme", content=long_description, branch="main"
)
except ImportError:
# when this package is being installed
return long_description
'디버깅 ( 오류 해결 과정 )' 카테고리의 다른 글
[Yolov8] 하이퍼파라미터 튜닝 UnboundLocalError 극복하기 (0) | 2024.04.02 |
---|---|
Android - NotFoundException 에러 해결 과정 (0) | 2023.01.27 |
MySQL - 테이블 이름과 MySQL의 키워드가 같을 때 오류 해결방법 (0) | 2023.01.17 |
AWS Lambda Layer ModuleNotFoundError ( 라이브러리 종속성,dependency ) (0) | 2023.01.12 |
Python DropNaN 이후 index 에러 해결과정 (0) | 2022.12.21 |