본문 바로가기

공부, 자격증/Vue.js

[vscode] Getting requirements to build wheel ... error MAC 해결

반응형

 

vscode에서 

pip install mysqlclient  

설치시 에러 해결!

 

$ pip install mysqlclient

pip install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-2.2.0.tar.gz (89 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
  ╰─> [27 lines of output]
      /bin/sh: pkg-config: command not found

해결은 공식문서를 보고 했습니다.

 

사이트의 중간 부분에 해결 방법이 나와 있습니다. 

https://pypi.org/project/mysqlclient/

 

mysqlclient

Python interface to MySQL

pypi.org

 

macOS(홈브루)

MySQL 및 mysqlclient를 설치합니다.

아래 명령어를 먼저 했는데, 안되서 그 아래에 있는 명령어로 해결했습니다. 

# Assume you are activating Python 3 venv
$ brew install mysql pkg-config
$ pip install mysqlclient

 

MySQL 서버를 설치하지 않으려면 대신 mysql-client를 사용할 수 있습니다.

# Assume you are activating Python 3 venv
$ brew install mysql-client pkg-config
$ export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql-client/lib/pkgconfig"
$ pip install mysqlclient

 

해결!!!! 

이제 django와 mysql을 연동만 하면 됩니다! 

 

반응형