왕현성
코딩발자취
왕현성
전체 방문자
오늘
어제
  • 코딩 (277)
    • Python (71)
    • Java (16)
    • MySQL (34)
    • 인공지능 (48)
      • 머신러닝 (16)
      • 딥러닝 (32)
    • 영상처리 (4)
    • Rest API (21)
    • Android Studio (25)
    • streamlit (13)
    • DevOps (22)
      • AWS (9)
      • PuTTY (5)
      • Git (4)
      • Serverless (2)
      • Docker (2)
    • IT 기술 용어 (6)
    • 디버깅 ( 오류 해결 과정 ) (17)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 딥러닝
  • maskimage
  • yolov8
  • labelme
  • numpy
  • unsupervised
  • TensorFlow
  • imageprocessing
  • 의료이미징
  • encoding='utf-8'
  • 영상처리
  • labelme UnocodeDecodeError
  • pip install labelme
  • alibi-detection
  • 기상탐사
  • get_long_description
  • OpenCV
  • pytorch
  • 비지도학습
  • PIL
  • alibidetect
  • ckpt_file
  • 영상처리역사
  • ComputerVision
  • matplotlib
  • 컴퓨터비전
  • UnboundLocalError
  • PYTHON
  • 영상기술
  • tune()

최근 댓글

최근 글

티스토리

250x250
hELLO · Designed By 정상우.
왕현성
디버깅 ( 오류 해결 과정 )

labelme 설치 중 UnocodeDecodeError 해결법

디버깅 ( 오류 해결 과정 )

labelme 설치 중 UnocodeDecodeError 해결법

2023. 8. 25. 15:15
728x90
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
    '디버깅 ( 오류 해결 과정 )' 카테고리의 다른 글
    • [Yolov8] 하이퍼파라미터 튜닝 UnboundLocalError 극복하기
    • Android - NotFoundException 에러 해결 과정
    • MySQL - 테이블 이름과 MySQL의 키워드가 같을 때 오류 해결방법
    • AWS Lambda Layer ModuleNotFoundError ( 라이브러리 종속성,dependency )
    왕현성
    왕현성
    AI 머신비전 학습일지

    티스토리툴바

    단축키

    내 블로그

    내 블로그 - 관리자 홈 전환
    Q
    Q
    새 글 쓰기
    W
    W

    블로그 게시글

    글 수정 (권한 있는 경우)
    E
    E
    댓글 영역으로 이동
    C
    C

    모든 영역

    이 페이지의 URL 복사
    S
    S
    맨 위로 이동
    T
    T
    티스토리 홈 이동
    H
    H
    단축키 안내
    Shift + /
    ⇧ + /

    * 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.