반응형
안녕하세요.
즐거운 우리집 (https://joyfulhome.tistory.com/) 입니다.
오늘은 pip로 psycopg2 설치시 나타나는 오류에 대해서 해결 방법에 대해서 알아보겠습니다.
오류 중에
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
가 나는군요...
어떤 오류인지 전체적으로 한 번 보실까요?
오류내용
joyfulhome % pip install psycopg2 Collecting psycopg2 Using cached psycopg2-2.9.6.tar.gz (383 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 ╰─> [35 lines of output] /private/var/folders/wr/85fcqmd94mz3bh61074s10l80000gn/T/pip-build-env-synyej24/overlay/lib/python3.11/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg` !! ******************************************************************************** The license_file parameter is deprecated, use license_files instead. By 2023-Oct-30, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details. ******************************************************************************** !! parsed = self.parsers.get(option_name, lambda x: x)(value) running egg_info writing psycopg2.egg-info/PKG-INFO writing dependency_links to psycopg2.egg-info/dependency_links.txt writing top-level names to psycopg2.egg-info/top_level.txt Error: pg_config executable not found. pg_config is required to build psycopg2 from source. Please add the directory containing pg_config to the $PATH or specify the full executable path with the option: python setup.py build_ext --pg-config /path/to/pg_config build ... or with the pg_config option in 'setup.cfg'. If you prefer to avoid building psycopg2 from source, please install the PyPI 'psycopg2-binary' package instead. For further information please check the 'doc/src/install.rst' file (also at <https://www.psycopg.org/docs/install.html>). [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. |
해당 오류는 PostgreSQL의 개발 라이브러리가 필요하기 때문에 발생합니다.
이 때에는 PostgreSQL 개발 라이브러리를 설치해 주어야 합니다.
PostgreSQL 개발 라이브러리 설치 방법은 다음과 같습니다.
반응형
해결을 위해서는 postgresql 를 설치해 줍니다.
brew 를 통하여 설치해 줍니다.
해결방법
brew install postgresql |
그럼 직접 콘솔에서 brew 를 이용하여 설치해볼까요?
이건 정상적으로 설치가 되어라~~~
그럼 고고씽~ ㅎㅎㅎ
사용방법
joyfulhome % brew install postgresql Warning: Formula postgresql was renamed to postgresql@14. Warning: Formula postgresql was renamed to postgresql@14. ==> Downloading https://formulae.brew.sh/api/cask.jws.json #=#=- # # #=O#- # # ==> Fetching dependencies for postgresql@14: krb5 and readline ==> Fetching krb5 ==> Downloading https://ghcr.io/v2/homebrew/core/krb5/manifests/1.21.1 #=#=- # # #=O#- # # -#O=- # # # ######################################################################################################################################################################################################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/krb5/blobs/sha256:fa17fb49aa0363f2de649bd8b6ca370d3a97dee5e7299bc07e6b7b344d4ccc59 #=#=- # # #=O#- # # -#O=- # # # ######################################################################################################################################################################################################################################################### 100.0% ==> Fetching readline ==> Downloading https://ghcr.io/v2/homebrew/core/readline/manifests/8.2.1 ######################################################################################################################################################################################################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/readline/blobs/sha256:fba42a9bd6feaa8902ae4491ffdf177662e0a165a0d0ddef0988ad6ecf0f23dd #=#=- # # #=O#- # # -#O=- # # # ######################################################################################################################################################################################################################################################### 100.0% ==> Fetching postgresql@14 ==> Downloading https://ghcr.io/v2/homebrew/core/postgresql/14/manifests/14.8_2 ######################################################################################################################################################################################################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/postgresql/14/blobs/sha256:606bce40d417b332cf842a44018155ee10010c9b800eeefc41c80333b6d4cc62 #=#=- # # #=O#- # # -#O=- # # # ######################################################################################################################################################################################################################################################### 100.0% ==> Installing dependencies for postgresql@14: krb5 and readline ==> Installing postgresql@14 dependency: krb5 ==> Pouring krb5--1.21.1.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/krb5/1.21.1: 162 files, 5.6MB ==> Installing postgresql@14 dependency: readline ==> Pouring readline--8.2.1.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/readline/8.2.1: 50 files, 1.7MB ==> Installing postgresql@14 ==> Pouring postgresql@14--14.8_2.arm64_ventura.bottle.tar.gz ==> /opt/homebrew/Cellar/postgresql@14/14.8_2/bin/initdb --locale=C -E UTF-8 /opt/homebrew/var/postgresql@14 ==> Caveats This formula has created a default database cluster with: initdb --locale=C -E UTF-8 /opt/homebrew/var/postgresql@14 For more details, read: https://www.postgresql.org/docs/14/app-initdb.html To start postgresql@14 now and restart at login: brew services start postgresql@14 Or, if you don't want/need a background service you can just run: /opt/homebrew/opt/postgresql@14/bin/postgres -D /opt/homebrew/var/postgresql@14 ==> Summary 🍺 /opt/homebrew/Cellar/postgresql@14/14.8_2: 3,315 files, 45.3MB ==> Running `brew cleanup postgresql@14`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). ==> Caveats ==> postgresql@14 This formula has created a default database cluster with: initdb --locale=C -E UTF-8 /opt/homebrew/var/postgresql@14 For more details, read: https://www.postgresql.org/docs/14/app-initdb.html To start postgresql@14 now and restart at login: brew services start postgresql@14 Or, if you don't want/need a background service you can just run: /opt/homebrew/opt/postgresql@14/bin/postgres -D /opt/homebrew/var/postgresql@14 |
postgresql 가 정상적으로 설치가 되었습니다.
그럼 이제 문제가 해결되었으니, 처음의 오류였던 psycopg2 를 다시 한 번 설치해 보겠습니다.
제발 제발 되어라~~~
오류 해결 후 정상 실행화면
joyfulhome % pip install psycopg2 Collecting psycopg2 Using cached psycopg2-2.9.6.tar.gz (383 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: psycopg2 Building wheel for psycopg2 (pyproject.toml) ... done Created wheel for psycopg2: filename=psycopg2-2.9.6-cp311-cp311-macosx_10_9_universal2.whl size=245161 sha256=39fabc1e7663ad6328ee1f85b57068dd9eb8b46d512a2a2e444904b78ffca164 Stored in directory: /Users/smile/Library/Caches/pip/wheels/a2/c5/3d/b8fd44767c125a321b8d6d7fbcce0181d2f2d1e34967c81365 Successfully built psycopg2 Installing collected packages: psycopg2 Successfully installed psycopg2-2.9.6 |
짠~ 해결되었네요.
같이 해결되었다면 축하드려요 ^^
그럼 오늘도 즐거운 하루 되세요~ ^^
반응형
'Development > 기타' 카테고리의 다른 글
postgresql 설치시 에러 해결방법 - Warning: No available formula with the name "homebrew/core/postgresql". (2) | 2023.07.20 |
---|---|
mac에서 github 로그인 시도시 Personal access tokens 인증 변경 (83) | 2023.05.24 |
[DB Tool] postgre SQL 관리툴인 pgAdmin 다운로드 및 설치 방법 (58) | 2022.10.14 |
[Git] 계정 저장하여 git 사용시 더이상 id, pw 물어보지 않는 방법 (64) | 2022.08.24 |
[Git] 'Fatal: 정방향이 불가능하므로, 중지합니다.' 오류 해결 방법 (6) | 2022.08.12 |