这是一个来自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就没问题了。。

Python mac安装mysqlclient的一个bug的更多相关文章

  1. Mac安装mysqlclient

    前言 祝大家身体健康 正文 如何在Mac上安装Python的mysqlclient模块 安装mysql brew install mysql 安装mysql-client brew install m ...

  2. python基础(2):python的安装、第一个python程序

    1. 第一个python程序 1.1 python的安装 自己百度,这是自学最基本的,安装一路确定即可,记得path下打钩. 1.2 python的编写 python程序有两种编写方式: 1.进入cm ...

  3. Mac 安装 mysqlclient

    尝试在虚拟环境下通过 pip 安装: pip install mysqlclient 然后报错:OSError: mysql_config not found 找到官方文档 https://githu ...

  4. 2. python Mac 安装 dlib

    在macOS上: 从Mac App Store安装 XCode(或安装XCode命令行工具)(最低版本是:xcode8 以上) 有 homebrew 安装 有 CMAKE 安装 基础包 :numpy ...

  5. Python django 安装 mysqlclient 失败

    使用命令安装失败: C:\Program Files (x86)\Python\Python37-\Scripts>pip3..exe install mysqlclient Collectin ...

  6. pytest 3.9在python 2.7下的一个bug

    最在在使用pytest,用的是pytest 3.9.3,python版本为2.7.10,但一直在使用时发现总提示 File "c:\python27\Lib\json\__init__.py ...

  7. RHEL7.1 安装openstack juno 一个BUG

    错误提示: -- :: ERROR nova.compute.manager [-] [instance: 887e5e40-ebd8--b2f7-afa2a37bdef8] Instance fai ...

  8. mac 安装 python mysqlclient 遇到的问题及解决方法

    在 mac 上安装 mysqlclient 遇到了一些问题,查找资料很多人都遇到了同样的问题.通过资料和试验,成功了.这里记录一下,希望帮到遇到同样问题的人. 本人使用python3, 安装步骤如下: ...

  9. Mac OS 安装mysqlclient 遇到的坑~

    最近在学习Python, 因为Django连接mysql 需要安装mysqlclient, 但Mac安装遇到各种问题,这里记录一下,避免以后再踩坑. 1.   正常情况下,安装mysqlclient ...

随机推荐

  1. leetcode 5 查找最长的回文子串

    给定一个字符串 s,找到 s 中最长的回文子串.你可以假设 s 的最大长度为 1000. 示例 1: 输入: "babad" 输出: "bab" 注意: &qu ...

  2. JDB与迭代

    要求 1 使用C(n,m)=C(n-1,m-1)+C(n-1,m)公式进行递归编程实现求组合数C(m,n)的功能 2 m,n 要通过命令行传入 3 提交测试运行截图(至少三张:正常如c(3,2).异常 ...

  3. SpringCloud(1)服务注册与发现Eureka

    1.创建1个空白的工程 2.创建2个model工程 一个module(即SpringBoot)工程作为服务注册中心,即Eureka Server,另一个作为Eureka Client. Eureka ...

  4. IPv6绝不仅仅是对IPv4地址长度的增加

    众所周知,IPv6 IP地址长度是IPv4 IP地址长度的四倍,是解决IPv4公共网址资源枯竭的最佳技术.的确,IETF在制定IPv6标准时也是基于这一因素考虑的.当时正是90年代初,Web开始出现, ...

  5. Nginx部署静态页

    简答说一下如何用Nginx部署静态网页,并绑定域名访问 1.通过FTP上传静态页到服务器指定目录 2.编写nginx的.conf文件 3.重启nginx 如图,这是centos上传文件路径 nginx ...

  6. [转帖]Go中的下划线

    Go中的下划线 https://blog.csdn.net/wanglei9876/article/details/50475864 下划线的作用: 在import 时 是仅引入 init 函数 在正 ...

  7. Python开发第一篇

    Python 是什么? 首先他可能是比较好的一个编程开发语言!

  8. LODOP不同打印机出现偏移问题

    方法简单描述:1.精确套打,设置以纸张边缘为基点,可避免不同可打区域不同带了的影响.2.不同客户端打印机位置差异,可通过打印维护调整,结果在客户端本地.或调整打印机初始位置(本人使用的金税盘的开票软件 ...

  9. CentOS_7升级系统内核

    最近,在虚拟机中安装docker成功之后,尝试运行docker run hello-world时出现以下错误: $ sudo docker run hello-world Unable to find ...

  10. re 模块 分组特别说明

    关于分组优先以及 " | " 的细致练习 from django.test import TestCase import re # Create your tests here. ...