zoukankan      html  css  js  c++  java
  • Python mac安装mysqlclient的一个bug

    这是一个来自mysql官方的bug,反正我是看不懂。

    shuais-MBP:wxapp dandyzhang$ pipenv install mysqlclient
    Installing mysqlclient...
    Collecting mysqlclient
      Using cached https://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/private/var/folders/rw/kmt8v6lj2fb37k0kh1ggm4m40000gn/T/pip-install-rwvfazf6/mysqlclient/setup.py", line 18, in <module>
            metadata, options = get_config()
          File "/private/var/folders/rw/kmt8v6lj2fb37k0kh1ggm4m40000gn/T/pip-install-rwvfazf6/mysqlclient/setup_posix.py", line 60, in get_config
            libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
          File "/private/var/folders/rw/kmt8v6lj2fb37k0kh1ggm4m40000gn/T/pip-install-rwvfazf6/mysqlclient/setup_posix.py", line 60, in <listcomp>
            libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
          File "/private/var/folders/rw/kmt8v6lj2fb37k0kh1ggm4m40000gn/T/pip-install-rwvfazf6/mysqlclient/setup_posix.py", line 13, in dequote
            raise Exception("Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?")
        Exception: Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?
        
        ----------------------------------------
    
    Error:  An error occurred while installing mysqlclient!
    Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/rw/kmt8v6lj2fb37k0kh1ggm4m40000gn/T/pip-install-rwvfazf6/mysqlclient/
    
    This is likely caused by a bug in mysqlclient. Report this to its maintainers.

    mysqlclient的作者在源码里已经写了个exception是专门针对这个报错的,就是上面加粗的那一句黑色的链接

    Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?

    它说,错误的mysql配置,可能是链接里的问题。

    这里就不打开链接了解释了,反正就是一个官方的bug,里面也写了怎么解决。

    首先安装mysql-connector

    brew install mysql-connector-c

    然后修改一下mysql_config文件,当然基于安全性的考虑需要先备份一下文件

    cp /usr/local/bin/mysql_config /usr/local/bin/mysql_config.backup 

    然后修改文件

    sudo vim /usr/local/bin/mysql_config 

    找到对应的内容位置

    # Create options 
    libs="-L$pkglibdir"
    libs="$libs -l "
    修改成
    # Create options 
    libs="-L$pkglibdir"
    libs="$libs -lmysqlclient -lssl -lcrypto"

    这时候安装mysqlclient就没问题了。。

  • 相关阅读:
    asp.net 中的viewstate用法?
    .net中 过滤 指定 字符串
    js中replace的用法
    restart
    外部函数
    JQuery实现Ajax 根据商品名称自动显示价格
    ListView中命令行按钮应用;
    GridView中获取行数和列数
    全局应用程序类Global
    如何获取gridview中模板列中控件的值?
  • 原文地址:https://www.cnblogs.com/wuzdandz/p/9712865.html
Copyright © 2011-2022 走看看