M1 MAC psycopg2 (PostgreSQL)

코디·2022년 8월 21일
0
post-thumbnail

M1 MAC psycopg2 설치방법

mac에서 pip install psycopg2를 입력하면,,설치하가 안되고 에러가 나는 경우가 있다.

아래 설치 방법으로 설치가 가능하다.

1. postgresql 설치

$ brew install postgresql

2. pip 업그레이드

$ /opt/homebrew/opt/python@3.9/bin/python3.9 -m pip install --upgrade pip

3. openssl 설치

$ brew install openssl

4. ./zshrc export

$ echo 'export LDFLAGS="-L/opt/homebrew/opt/openssl/lib"' >> ~/.zshrc
$ echo 'export CPPFLAGS="-I/opt/homebrew/opt/openssl/include"' >> ~/.zshrc
$ source ~/.zshrc

5. psycopg2 install

$ pip install psycopg2 --no-cache-dir
profile
Django DRF, Express, React, React Native, Next,js.......

0개의 댓글