카테고리 없음

python3.10 venv No module named 'MySQLdb'

ForceCore 2023. 4. 4. 11:43

맨날 까먹는데, 해법이 너무 옛날 것들이 검색됨.

venv환경에서 이를 해결보려면...

 

https://stackoverflow.com/questions/48617779/virtualenv-importerror-no-module-named-mysqldb

 

VirtualEnv ImportError: No module named MySQLdb

I am receiving the error: ImportError: No module named MySQLdb whenever I try to run my local dev server and it is driving me crazy. I have tried everything I could find online: brew install mysql...

stackoverflow.com

 

 

sudo apt-get install python3-mysqldb
sudo apt-get install libmysqlclient-dev
pip install mysqlclient

이렇게 하면 됨.

 

     MySQLdb/_mysql.c:46:10: fatal error: Python.h: No such file or directory
        46 | #include "Python.h"
           |          ^~~~~~~~~~

이거는 python3.10-dev 도 깔아야 해결됨.