본문 바로가기
ERROR

Failed building wheel for backports.zoneinfo 에러

by 코드뭉치 2023. 4. 9.

requirements.txt를 이용해 라이브러리를 설치 중 특정 파일에서 계속 에러가 발생.

$ pip install -r requirements.txt
Collecting asgiref==3.6.0
  Using cached asgiref-3.6.0-py3-none-any.whl (23 kB)
Collecting backports.zoneinfo==0.2.1
  Using cached backports.zoneinfo-0.2.1.tar.gz (74 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting Django==4.2
  Using cached Django-4.2-py3-none-any.whl (8.0 MB)
Collecting sqlparse==0.4.3
  Using cached sqlparse-0.4.3-py3-none-any.whl (42 kB)
Collecting tzdata==2023.3
  Using cached tzdata-2023.3-py2.py3-none-any.whl (341 kB)
Building wheels for collected packages: backports.zoneinfo
  Building wheel for backports.zoneinfo (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for backports.zoneinfo (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      C:\Users\<사용자명>\AppData\Local\Temp\pip-build-env-ts0ashsy\overlay\Lib\site-packages\setuptools\config\setupcfg.py:516: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\backports
      copying src\backports\__init__.py -> build\lib.win-amd64-cpython-311\backports
      creating build\lib.win-amd64-cpython-311\backports\zoneinfo
      copying src\backports\zoneinfo\_common.py -> build\lib.win-amd64-cpython-311\backports\zoneinfo
      copying src\backports\zoneinfo\_tzpath.py -> build\lib.win-amd64-cpython-311\backports\zoneinfo
      copying src\backports\zoneinfo\_version.py -> build\lib.win-amd64-cpython-311\backports\zoneinfo
      copying src\backports\zoneinfo\_zoneinfo.py -> build\lib.win-amd64-cpython-311\backports\zoneinfo
      copying src\backports\zoneinfo\__init__.py -> build\lib.win-amd64-cpython-311\backports\zoneinfo
      running egg_info
      writing src\backports.zoneinfo.egg-info\PKG-INFO
      writing dependency_links to src\backports.zoneinfo.egg-info\dependency_links.txt
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for backports.zoneinfo
Failed to build backports.zoneinfo
ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects

해당 에러는 backports.zoneinfo 라이브러리를 빌드하는 과정에서 발생한 것이다.

backports.zoneinfo는 Python 3.9 이전 버전에서 zoneinfo 모듈을 지원하기 위해 만들어진 라이브러리이므로,

Python 3.9 이상의 버전에서는 zoneinfo 모듈이 이미 내장되어 있으므로 필요하지 않다.

해결 방법

requirements.txt에서 backports.zoneinfo를 제거하고, 다시 pip install -r requirements.txt를 실행하는 것.

 

만약 backports.zoneinfo가 다른 패키지의 의존성으로 포함되어 있다면, 해당 패키지에서 해당 라이브러리를 제거하거나, Python 버전을 업그레이드하시는 것이 좋다.

댓글