-
Notifications
You must be signed in to change notification settings - Fork 444
Description
Hello, I tried to import MySQLdb but got error message as following:
import MySQLdb
Traceback (most recent call last):
File "", line 1, in
File "/Volumes/develop/Application/anaconda3/envs/chatchat/lib/python3.10/site-packages/MySQLdb/init.py", line 17, in
from . import _mysql
ImportError: dlopen(/Volumes/develop/Application/anaconda3/envs/chatchat/lib/python3.10/site-packages/MySQLdb/_mysql.cpython-310-darwin.so, 0x0002): Library not loaded: @rpath/libmysqlclient.24.dylib
Referenced from: /Volumes/develop/Application/anaconda3/envs/chatchat/lib/python3.10/site-packages/MySQLdb/_mysql.cpython-310-darwin.so
Reason: tried: '/Volumes/develop/Application/anaconda3/envs/chatchat/lib/libmysqlclient.24.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Volumes/develop/Application/anaconda3/envs/chatchat/lib/libmysqlclient.24.dylib' (no such file), '/Volumes/develop/Application/anaconda3/envs/chatchat/lib/libmysqlclient.24.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Volumes/develop/Application/anaconda3/envs/chatchat/lib/libmysqlclient.24.dylib' (no such file), '/Volumes/develop/Application/anaconda3/envs/chatchat/bin/../lib/libmysqlclient.24.dylib' (no such file), '/Volumes/develop/Application/anaconda3/envs/chatchat/bin/../lib/libmysqlclient.24.dylib' (no such file)
I'm using M3 Macbookpro, OS: Sonoma 14.3
I installed mysqlclient in the directory /Volumes/develop/Application/anaconda3/envs/chatchat/lib/python3.10/site-packages/
and mysql v8.4.0 in the directory /usr/local/mysql
I set PKG_CONFIG_PATH=/usr/local/mysql/lib/pkgconfig
The library libmysqlclient.24.dylib is under the mysql installed directory but mysqlclient seems to search wrong paths.