본문 바로가기

Error and Solve

[오류 해결] ERROR: Failed building wheel for psycopg2 / pip install psycopg2-binary

반응형

 

 

오류: ERROR: Failed building wheel for psycopg2

 

 

 

      In file included from psycopg/adapter_asis.c:28:
      ./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
         36 | #include <libpq-fe.h>
            |          ^~~~~~~~~~~~
      compilation terminated.
        

note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2
error: failed-wheel-build-for-install

 

pip install psycopg2

pip install psycopg2

 

 

psycopg2 를 설치하려고 보니 위와 같이 Error: Failed building wheel for psycopg2 에러가 났다.

 

 

 

 

 

해결: pip install psycopg2-binary

 

 

오류가 난 이유는 libpq-fe.h  라는 헤더 파일이 없기 때문에 의존성 문제가 생겼기 때문이다. 

 

이를 해결하기 위해 binary psycopg를 다운받으면 된다. 

 

 

 

pip install psycopg2-binary

pip install psycopg2-binary

 

 

그러면 psycopy 의존성 문제는 해결된다.


 

 

 

 

 

 

 

 

반응형