zoukankan      html  css  js  c++  java
  • mac 解决mysqlclient安装失败问题

    环境 mac
    本人下载mysql 是采用brew 下载,所以安装路径在/usr/local/Cellar/mysql/8.0.19_1/

    brew install mysql
    brew install mysql-connector-c
    sudo sed -i -e 's/libs="$libs -l "/libs="$libs -lmysqlclient -lssl -lcrypto"/g' /usr/local/mysql/bin/mysql_config
    下载mysql-client
    brew install mysql-client
    路径在:/usr/local/Cellar/mysql-client/8.0.19/

    采用Django启动项目报错
    django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.

    Did you install mysqlclient?

    下载mysqlclient
    pip install mysqlclient
    下载时报错
    报错 1:
    _mysql.c:29:10: fatal error: 'my_config.h' file not found

    #include "my_config.h"
    
             ^~~~~~~~~~~~~
    
    1 error generated.
    
    error: command '/usr/bin/clang' failed with exit status 1
    

    解决办法:
    export DYLD_LIBRARY_PATH="/usr/local/Cellar/mysql/8.0.19_1/lib"
    本人是采用brew 下载mysql 的,所以。存储路径是/usr/local/Cellar/mysql/8.0.19_1/ 。

    报错2
    File "/private/var/folders/wy/4v8w8ht90m7_1xzxklx1tnsm0000gn/T/pip-install-bbm57hwr/mysqlclient/setup_posix.py", line 47, in get_config

        libs = mysql_config("libs_r")
    
      File "/private/var/folders/wy/4v8w8ht90m7_1xzxklx1tnsm0000gn/T/pip-install-bbm57hwr/mysqlclient/setup_posix.py", line 29, in mysql_config
    
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    
    OSError: mysql_config not found
    
    ----------------------------------------
    

    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    解决办法:
    export PATH=$PATH:/usr/local/Cellar/mysql/8.0.s19_1/bin

    报错3:
    ld: library not found for -lssl

    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    error: command '/usr/bin/clang' failed with exit status 1
    

    解决办法:
    export PATH="/usr/local/Cellar/mysql-client/8.0.19/bin:$PATH"
    至此下载成功。

  • 相关阅读:
    webservice时间类型XMLGregorianCalendar和Date的转换
    webservice中jaxws:server 和jaxws:endpoint的区别
    使用CXF开发JAX-WS类型的WebService
    使用TCP/IP Monitor监视Soap协议
    Webservice优缺点总结
    WebService两种调用方法
    DOS命令运行java文件,批量引用jar包
    eclipse创建的maven项目无法部署到tomcat
    图片翻转效果
    掷骰子效果
  • 原文地址:https://www.cnblogs.com/heych/p/13060945.html
Copyright © 2011-2022 走看看