当前位置:   article > 正文

Python 报错 Library not loaded: libmysqlclient.18.dylib解决方式_pssh python library not loaded:

pssh python library not loaded:

'Did you install mysqlclient or MySQL-python?' % e

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/usr/local/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib

  Referenced from: /usr/local/lib/python2.7/site-packages/_mysql.so

  Reason: image not found.

Did you install mysqlclient or MySQL-python?

编辑文件:/Users/YourMacUserName/.bash_profile 

export PATH=$PATH:/usr/local/mysql/bin

export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/

然后使变更生效"source ~/.bash_profile"即可正确导入MySQLdb模块。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/951043
推荐阅读
相关标签
  

闽ICP备14008679号