python mysqldb err on my mac :Library not loaded: @rpath/libmysqlclient.21.dylib

后端 未结 2 1649
盖世英雄少女心
盖世英雄少女心 2021-01-16 16:26
import MySQLdb

leads to

Traceback (most recent call last):
  File \"\", line 1, in 
  File \"build/bdist         


        
2条回答
  •  星月不相逢
    2021-01-16 17:06

    So, from what I can tell, the @rpath tries to resolve to /usr/lib, which can't be written to. I resolved this by crawling through this site. A lot of it is in Chinese, but what I got was the command sudo install_name_tool -change @rpath/libmysqlclient.21.dylib /usr/local/mysql/lib/libmysqlclient.21.dylib /Users/[username]/.pyenv/versions/career/lib/python2.7/site-packages/_mysql.so

提交回复
热议问题