Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos mysql-python安装程序_Macos_Python 2.7_Mysql Python - Fatal编程技术网

Macos mysql-python安装程序

Macos mysql-python安装程序,macos,python-2.7,mysql-python,Macos,Python 2.7,Mysql Python,在osx版本10.12.3上安装mysql python时,不断出现此错误,即使使用virtualenv,我也会遇到相同的错误。使用brew安装mysql(mysql版本14.14发行版5.7.17,适用于osx10.12(x86_64)),setuptools版本为18.5 sudopip安装mysql-python Installing collected packages: mysql-python Running setup.py install for mysql-python ..

在osx版本10.12.3上安装mysql python时,不断出现此错误,即使使用virtualenv,我也会遇到相同的错误。使用brew安装mysql(mysql版本14.14发行版5.7.17,适用于osx10.12(x86_64)),setuptools版本为18.5

sudopip安装mysql-python

 Installing collected packages: mysql-python
Running setup.py install for mysql-python ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-ihGRLH/mysql-python/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-5ktJF8-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.12-intel-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.12-intel-2.7
creating build/lib.macosx-10.12-intel-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb
creating build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.12-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/5.7.17/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.12-intel-2.7/_mysql.o -fno-omit-frame-pointer
_mysql.c:287:14: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                cmd_argc = PySequence_Size(cmd_args);
                         ~ ^~~~~~~~~~~~~~~~~~~~~~~~~
_mysql.c:317:12: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                groupc = PySequence_Size(groups);
                       ~ ^~~~~~~~~~~~~~~~~~~~~~~
_mysql.c:470:14: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                        int j, n2=PySequence_Size(fun);
                               ~~ ^~~~~~~~~~~~~~~~~~~~
_mysql.c:1127:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                len = mysql_real_escape_string(&(self->connection), out, in, size);
                    ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_mysql.c:1129:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                len = mysql_escape_string(out, in, size);
                    ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_mysql.c:1168:9: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
        size = PyString_GET_SIZE(s);
             ~ ^~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:92:32: note: expanded from macro 'PyString_GET_SIZE'
#define PyString_GET_SIZE(op)  Py_SIZE(op)
                               ^~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:116:56: note: expanded from macro 'Py_SIZE'
#define Py_SIZE(ob)             (((PyVarObject*)(ob))->ob_size)
                                 ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
_mysql.c:1178:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                len = mysql_real_escape_string(&(self->connection), out+1, in, size);
                    ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_mysql.c:1180:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                len = mysql_escape_string(out+1, in, size);
                    ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_mysql.c:1274:11: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
        if ((n = PyObject_Length(o)) == -1) goto error;
               ~ ^~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/abstract.h:434:25: note: expanded from macro 'PyObject_Length'
#define PyObject_Length PyObject_Size
                        ^
_mysql.c:1466:10: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                        len = strlen(buf);
                            ~ ^~~~~~~~~~~
_mysql.c:1468:10: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                        len = strlen(buf);
                            ~ ^~~~~~~~~~~
_mysql.c:1504:11: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                                len = strlen(buf);
                                    ~ ^~~~~~~~~~~
_mysql.c:1506:11: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                                len = strlen(buf);
                                    ~ ^~~~~~~~~~~
_mysql.c:1589:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
        if (how < 0 || how >= sizeof(row_converters)) {
            ~~~ ^ ~
14 warnings generated.
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.7.17/include/mysql/my_config.h:172:9: warning: 'SIZEOF_LONG' macro redefined [-Wmacro-redefined]
#define SIZEOF_LONG      8
        ^
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:54:17: note: previous definition is here
#        define SIZEOF_LONG             4
                ^
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.7.17/include/mysql/my_config.h:177:9: warning: 'SIZEOF_TIME_T' macro redefined [-Wmacro-redefined]
#define SIZEOF_TIME_T    8
        ^
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:57:17: note: previous definition is here
#        define SIZEOF_TIME_T           4
                ^
_mysql.c:1589:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
        if (how < 0 || how >= sizeof(row_converters)) {
            ~~~ ^ ~
3 warnings generated.
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.12-intel-2.7/_mysql.o -L/usr/local/Cellar/mysql/5.7.17/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.12-intel-2.7/_mysql.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1

----------------------------------------
 Command "/usr/bin/python -u -c "import setuptools,       tokenize;__file__='/private/tmp/pip-build-ihGRLH/mysql-python/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-5ktJF8-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-ihGRLH/mysql-python/
安装收集的软件包:mysql-python
正在运行针对mysql python的setup.py安装。。。错误
从命令/usr/bin/python-u-c“import setuptools,tokenize;uuu file,'\n'''/private/tmp/pip build ihGRLH/mysql python/setup.py';f=getattr(tokenize,'open',open)(uuuuuu文件uuu);code=f.read().replace('\r\n','\n');f.close();exec(compile(code,'uu文件,'exec'))安装--record/tmp/pip-5ktJF8-record/install-record.txt--外部管理的单一版本--编译:
正在运行的安装
运行构建
运行build\u py
创建构建
创建build/lib.macosx-10.12-intel-2.7
正在复制_mysql_exceptions.py->build/lib.macosx-10.12-intel-2.7
创建build/lib.macosx-10.12-intel-2.7/MySQLdb
正在复制MySQLdb/uuuu init_uuuuu.py->build/lib.macosx-10.12-intel-2.7/MySQLdb
复制MySQLdb/converters.py->build/lib.macosx-10.12-intel-2.7/MySQLdb
正在复制MySQLdb/connections.py->build/lib.macosx-10.12-intel-2.7/MySQLdb
复制MySQLdb/cursors.py->build/lib.macosx-10.12-intel-2.7/MySQLdb
正在复制MySQLdb/release.py->build/lib.macosx-10.12-intel-2.7/MySQLdb
正在复制MySQLdb/times.py->build/lib.macosx-10.12-intel-2.7/MySQLdb
创建build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/_init__.py->build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/CR.py->build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/FIELD_TYPE.py->build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/ER.py->build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/FLAG.py->build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/REFRESH.py->build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/CLIENT.py->build/lib.macosx-10.12-intel-2.7/MySQLdb/constants
运行build_ext
正在生成“\u mysql”扩展
创建内部版本/临时版本macosx-10.12-intel-2.7
cc-fno严格别名-fno公共-动态-arch x86_64-arch i386-g-Os-pipe-fno公共-fno严格别名-fwrapv-DENABLE_DTRACE-DMACOSX-DNDEBUG-Wall-Wstrict原型-Wshorten-64-to-32-DNDEBUG-g-fwrapv-Os-Wall-Wstrict原型-DENABLE_DTRACE-arch x86_64-arch i386-pipe-Dversion\u信息=(1,2,5,'final','1)-D__=1.2.5-I/usr/local/ceral/mysql/5.7.17/include/mysql-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7-c_mysql.c-o build/temp.macosx-10.12-intel-2.7/_mysql.o-fno省略帧指针
_警告:隐式转换丢失整数精度:“Py_ssize_t”(也称为“long”)到“int”[-Wshorten-64-to-32]
cmd_argc=PySequence_Size(cmd_args);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~
_警告:隐式转换会丢失整数精度:“Py_ssize_t”(也称为“long”)到“int”[-Wshorten-64-to-32]
groupc=PySequence\u Size(组);
~ ^~~~~~~~~~~~~~~~~~~~~~~
_警告:隐式转换丢失整数精度:“Py_ssize_t”(也称为“long”)到“int”[-Wshorten-64-to-32]
int j,n2=PySequence_大小(fun);
~~ ^~~~~~~~~~~~~~~~~~~~
_警告:隐式转换丢失整数精度:“unsigned long”到“int”[-Wshorten-64-to-32]
len=mysql\u real\u escape\u字符串(&(self->connection),out,in,size);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_警告:隐式转换丢失整数精度:“unsigned long”到“int”[-Wshorten-64-to-32]
len=mysql\u escape\u字符串(out、in、size);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_警告:隐式转换丢失整数精度:“Py_ssize_t”(又称“long”)到“int”[-Wshorten-64-to-32]
大小=PyString\u GET\u大小;
~ ^~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:92:32:注意:从宏“PyString\u GET\u SIZE”展开
#定义PyString_GET_SIZE(op)Py_SIZE(op)
^~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:116:56:注意:从宏“Py_SIZE”展开
#定义Py_大小(ob)(((PyVarObject*)(ob))->ob_大小)
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
_警告:隐式转换丢失整数精度:“unsigned long”到“int”[-Wshorten-64-to-32]
len=mysql\u real\u escape\u字符串(&(self->connection),out+1,in,size);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_警告:隐式转换丢失整数精度:“unsigned long”到“int”[-Wshorten-64-to-32]
len=mysql\u escape\u字符串(out+1,in,size);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_c:1274:11:警告:隐式转换丢失整数精度:“Py_ssize_t”(也称为“long”)到“int”[-Wshorten-64-to-32]
如果((n=PyObject_Length(o))==-1)转到错误;
~ ^~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/abstract.h:434:25:注意:从宏“PyObject\u Length”展开
#定义PyObject_长度PyObject_大小
^
_警告:隐式转换丢失整数精度:“unsigned long”到“int”[-Wshorten-64-to-32]
len=strlen(buf);
~ ^~~~~~~~~~~
_警告:隐式转换丢失整数精度:“unsigned long”到“int”[-Wshorten-64-to-32]
len=strlen(buf
brew install openssl
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/