首页 > 数据库技术 > 详细

安装mysqlclient, 链接mysql失败,提示“Library not loaded: @rpath/libmysqlclient.21.dylib”

时间:2018-09-07 23:12:20      阅读:1280      评论:0      收藏:0      [点我收藏+]

问题:

    >>> import MySQLdb

    Traceback (most recent call last):

      File "<stdin>", line 1, in <module>

      File "/anaconda3/envs/LearnDjango/lib/python2.7/site-packages/MySQLdb/__init__.py", line 18, in <module>

        import _mysql

    ImportError: dlopen(/anaconda3/envs/LearnDjango/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: @rpath/libmysqlclient.21.dylib

      Referenced from: /anaconda3/envs/LearnDjango/lib/python2.7/site-packages/_mysql.so

      Reason: image not found

 

解决办法:

    1、关闭csrutil

    2、找到mysql安装路径,建立软连接

sudo ln -s /usr/local/mysql/lib/libmysqlclient.21.dylib /usr/lib/libmysqlclient.21.dylib

安装mysqlclient, 链接mysql失败,提示“Library not loaded: @rpath/libmysqlclient.21.dylib”

原文:https://www.cnblogs.com/tim-eff/p/9607472.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!