美文网首页
「Python」使用flask_sqlalchemy连接数据库获

「Python」使用flask_sqlalchemy连接数据库获

作者: ray_1942 | 来源:发表于2018-12-12 15:39 被阅读0次

    错误:

    builtins.ImportError
    ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_mysql.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libmysqlclient.21.dylib
      Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_mysql.cpython-37m-darwin.so
      Reason: image not found
    
    image.png
    解决办法:
    sudo install_name_tool -change @rpath/libmysqlclient.21.dylib /usr/local/mysql/lib/libmysqlclient.21.dylib /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_mysql.cpython-37m-darwin.so
    前半部分路径基本一样
    后半部分路径因人而异
    

    相关文章

      网友评论

          本文标题:「Python」使用flask_sqlalchemy连接数据库获

          本文链接:https://www.haomeiwen.com/subject/wckehqtx.html