博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mac下安装mysqlcient 报错
阅读量:4479 次
发布时间:2019-06-08

本文共 4380 字,大约阅读时间需要 14 分钟。

一、我在mac下pip3安装mysqlclient 报错:

pip3 install mysqlclientCollecting mysqlclient  Using cached mysqlclient-1.3.12.tar.gzInstalling collected packages: mysqlclient  Running setup.py install for mysqlclient ... error    Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-1ecj4utc/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-442qoq4k-record/install-record.txt --single-version-externally-managed --compile:    running install    running build    running build_py    creating build    creating build/lib.macosx-10.6-intel-3.6    copying _mysql_exceptions.py -> build/lib.macosx-10.6-intel-3.6    creating build/lib.macosx-10.6-intel-3.6/MySQLdb    copying MySQLdb/__init__.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb    copying MySQLdb/compat.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb    copying MySQLdb/connections.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb    copying MySQLdb/converters.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb    copying MySQLdb/cursors.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb    copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb    copying MySQLdb/times.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb    creating build/lib.macosx-10.6-intel-3.6/MySQLdb/constants    copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants    copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants    copying MySQLdb/constants/CR.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants    copying MySQLdb/constants/ER.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants    copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants    copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants    running build_ext    building '_mysql' extension    creating build/temp.macosx-10.6-intel-3.6    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Dversion_info=(1,3,12,'final',0) -D__version__=1.3.12 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.6-intel-3.6/_mysql.o    In file included from _mysql.c:29:    In file included from /usr/local/mysql/include/mysql.h:71:    In file included from /usr/local/mysql/include/mysql_com.h:995:    /usr/local/mysql/include/mysql/udf_registration_types.h:79:28: warning: this function declaration is not a prototype [-Wstrict-prototypes]    typedef void(*Udf_func_any)();                               ^                                void    _mysql.c:1894:3: error: use of undeclared identifier 'my_bool'                    my_bool recon = reconnect;                    ^    _mysql.c:1895:58: error: use of undeclared identifier 'recon'                    mysql_options(&self->connection, MYSQL_OPT_RECONNECT, &recon);                                                                           ^    1 warning and 2 errors generated.    error: command '/usr/bin/clang' failed with exit status 1        ----------------------------------------Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-1ecj4utc/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-442qoq4k-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-1ecj4utc/mysqlclient/sh-3.2# file /usr/bin/clang

 

 

二、报错原因:

  1、之前还安装成功的、从新安装了一下python3.6然后安装mysqlclient就不行了、最后确认是mac上的mysq-8.0.3引起的

  于是把mysql-8.0.3 回滚到了mysql-5.7-16 安装完成了。

 

三、安装完成:

pip3 install mysqlclientCollecting mysqlclient  Using cached mysqlclient-1.3.12.tar.gzInstalling collected packages: mysqlclient  Running setup.py install for mysqlclient ... doneSuccessfully installed mysqlclient-1.3.12

 

转载于:https://www.cnblogs.com/JiangLe/p/7839910.html

你可能感兴趣的文章
什么是DevOps?
查看>>
[转]跟紧时代,让你的设计更加popular
查看>>
C# 中的委托和事件
查看>>
简单的dfs题 --- POJ1321 棋盘问题
查看>>
新写的一个计算器,里面还有部分bug,望大家指正
查看>>
项目对页面和业务的反思
查看>>
Git Flow 代码版本控制模型
查看>>
共享书籍
查看>>
maven项目诡异的问题
查看>>
bign(高精度运算模板)
查看>>
git小记
查看>>
个人项目滴总结
查看>>
今晚又一场世纪之战
查看>>
二分搜索应用(旋转数组)——C语言
查看>>
webshell下破解mysql的root密码的php脚本
查看>>
typeHandler
查看>>
java向上取整向下取整
查看>>
Mac在Finder中显示隐藏文件
查看>>
求1...n中因子最多的数
查看>>
冒泡排序
查看>>