有没有办法将mariadb与python2.7连接起来

有没有办法将mariadb与python2.7连接起来,python,macos,python-2.7,mariadb,erpnext,Python,Macos,Python 2.7,Mariadb,Erpnext,在我的MacOSX中,我尝试使用python2.7和mariadb。 我正在使用pip安装mysql-python或pip安装mysqlclient作为连接器。但系统总是给我一大堆错误。有没有其他方法可以解决这个问题 ERROR: Command errored out with exit status 1: command: /Users/eskimi/Development/ErpNext/frappe-bench/env/bin/python -u -c 'import sys, s

在我的MacOSX中,我尝试使用python2.7和mariadb。 我正在使用
pip安装mysql-python
pip安装mysqlclient
作为连接器。但系统总是给我一大堆错误。有没有其他方法可以解决这个问题

ERROR: Command errored out with exit status 1:
   command: /Users/eskimi/Development/ErpNext/frappe-bench/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-gccSRs/mysql-python/setup.py'"'"'; __file__='"'"'/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-gccSRs/mysql-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-wheel-MTABvV --python-tag cp27
       cwd: /private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-gccSRs/mysql-python/
  Complete output (41 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14-intel-2.7
  copying _mysql_exceptions.py -> build/lib.macosx-10.14-intel-2.7
  creating build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/__init__.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/converters.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/connections.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/cursors.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/release.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/times.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  creating build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/CR.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/ER.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  running build_ext
  building '_mysql' extension
  creating build/temp.macosx-10.14-intel-2.7
  cc -fno-strict-aliasing -fno-common -dynamic -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 i386 -arch x86_64 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql/.. -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.14-intel-2.7/_mysql.o
  In file included from _mysql.c:44:
  /usr/local/Cellar/mariadb/10.4.6_1/include/mysql/my_config.h:3:2: warning: This file should not be included by clients, include only <mysql.h> [-W#warnings]
  #warning This file should not be included by clients, include only <mysql.h>
   ^
  In file included from _mysql.c:46:
  /usr/local/Cellar/mariadb/10.4.6_1/include/mysql/mysql.h:441:3: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    MYSQL_CLIENT_PLUGIN_HEADER
    ^
  /usr/local/Cellar/mariadb/10.4.6_1/include/mysql/mysql.h:437:16: note: expanded from macro 'MYSQL_CLIENT_PLUGIN_HEADER'
    int (*deinit)();                                      \
                 ^
  _mysql.c:2005:42: error: no member named 'reconnect' in 'struct st_mysql'
          if ( reconnect != -1 ) self->connection.reconnect = reconnect;
                                 ~~~~~~~~~~~~~~~~ ^
  2 warnings and 1 error generated.
  error: command 'cc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for mysql-python
    ERROR: Command errored out with exit status 1:
     command: /Users/eskimi/Development/ErpNext/frappe-bench/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-gccSRs/mysql-python/setup.py'"'"'; __file__='"'"'/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-gccSRs/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 /private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-record-PZ6DCs/install-record.txt --single-version-externally-managed --compile --install-headers /Users/eskimi/Development/ErpNext/frappe-bench/env/include/site/python2.7/mysql-python
         cwd: /private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-gccSRs/mysql-python/
    Complete output (41 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-intel-2.7
    copying _mysql_exceptions.py -> build/lib.macosx-10.14-intel-2.7
    creating build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/converters.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/connections.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/release.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/times.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    creating build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    running build_ext
    building '_mysql' extension
    creating build/temp.macosx-10.14-intel-2.7
    cc -fno-strict-aliasing -fno-common -dynamic -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 i386 -arch x86_64 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql/.. -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.14-intel-2.7/_mysql.o
    In file included from _mysql.c:44:
    /usr/local/Cellar/mariadb/10.4.6_1/include/mysql/my_config.h:3:2: warning: This file should not be included by clients, include only <mysql.h> [-W#warnings]
    #warning This file should not be included by clients, include only <mysql.h>
     ^
    In file included from _mysql.c:46:
    /usr/local/Cellar/mariadb/10.4.6_1/include/mysql/mysql.h:441:3: warning: this function declaration is not a prototype [-Wstrict-prototypes]
      MYSQL_CLIENT_PLUGIN_HEADER
      ^
    /usr/local/Cellar/mariadb/10.4.6_1/include/mysql/mysql.h:437:16: note: expanded from macro 'MYSQL_CLIENT_PLUGIN_HEADER'
      int (*deinit)();                                      \
                   ^
    _mysql.c:2005:42: error: no member named 'reconnect' in 'struct st_mysql'
            if ( reconnect != -1 ) self->connection.reconnect = reconnect;
                                   ~~~~~~~~~~~~~~~~ ^
    2 warnings and 1 error generated.
    error: command 'cc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/eskimi/Development/ErpNext/frappe-bench/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-gccSRs/mysql-python/setup.py'"'"'; __file__='"'"'/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-gccSRs/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 /private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-record-PZ6DCs/install-record.txt --single-version-externally-managed --compile --install-headers /Users/eskimi/Development/ErpNext/frappe-bench/env/include/site/python2.7/mysql-python Check the logs for full command output.
Traceback (most recent call last):
错误:命令出错,退出状态为1:
命令:/Users/eskimi/Development/ErpNext/frappebench/env/bin/python-u-c'import sys、setuptools、tokenize;sys.argv[0]=“private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip install gccSRs/mysql python/setup.py”__文件“''/private/var/folders/1r/0z4”\u dp3j0237vqx1jvc0sn3c0000gp/T/pip install gccSRs/mysql python/setup.py''”;f=getattr(标记化,“'open'”,open)(\uuuuu文件);code=f.read().replace(“\r\n”“”、“\n”“”);f、 close();exec(编译(代码,“'exec'”)'bdist_wheel-d/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip wheel MTABvV--python标记cp27
cwd:/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip安装gccSRs/mysql python/
完整输出(41行):
运转的车轮
运行构建
运行build\u py
创建构建
创建build/lib.macosx-10.14-intel-2.7
正在复制_mysql_exceptions.py->build/lib.macosx-10.14-intel-2.7
创建build/lib.macosx-10.14-intel-2.7/MySQLdb
正在复制MySQLdb/uuuu init_uuuuu.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
复制MySQLdb/converters.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
正在复制MySQLdb/connections.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
复制MySQLdb/cursors.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
正在复制MySQLdb/release.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
正在复制MySQLdb/times.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
创建build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/_init__.py->build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/CR.py->build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/FIELD_TYPE.py->build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/ER.py->build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/FLAG.py->build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/REFRESH.py->build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/CLIENT.py->build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
运行build_ext
正在生成“\u mysql”扩展
创建内部版本/临时版本macosx-10.14-intel-2.7
cc-fno严格别名-fno common-dynamic-g-Os-pipe-fno common-fno严格别名-FNRAPV-DENABLE_DTRACE-DMACOSX-DNDEBUG-Wall-Wstrict原型-Wshorten-64-to-32-DNDEBUG-g-fwrapv-Os-Wall-Wstrict原型-DENABLE_DTRACE-arch i386-arch x86_64-pipe-Dversion_info=(1,2,5,'final',1)-D_uuversion_uuu=1.2.5-I/usr/local/ceral/mariadb/10.4.6_1/include/mysql-I/usr/local/ceral/mariadb/10.4.6_1/include/mysql/-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7-c_mysql.c-o build/temp.macosx-10.14-intel-2.7/_mysql.o
在_mysql.c:44中包含的文件中:
/usr/local/ceral/mariadb/10.4.6_1/include/mysql/my_config.h:3:2:警告:客户端不应包含此文件,仅包含[-W#警告]
#警告:客户端不应包括此文件,仅包括
^
在_mysql.c:46中包含的文件中:
/usr/local/ceral/mariadb/10.4.6_1/include/mysql/mysql.h:441:3:警告:此函数声明不是原型[-Wstrict-prototype]
MYSQL\u客户端\u插件\u头
^
/usr/local/ceral/mariadb/10.4.6\u 1/include/mysql/mysql.h:437:16:注意:从宏“mysql\u CLIENT\u PLUGIN\u HEADER”展开
int(*脱硝剂)()\
^
_mysql.c:2005:42:错误:“struct st_mysql”中没有名为“reconnect”的成员
如果(重新连接!=-1)自->连接。重新连接=重新连接;
~~~~~~~~~~~~~~~~ ^
生成2个警告和1个错误。
错误:命令“cc”失败,退出状态为1
----------------------------------------
错误:为mysql python构建控制盘失败
错误:命令出错,退出状态为1:
命令:/Users/eskimi/Development/ErpNext/frappebench/env/bin/python-u-c'import sys、setuptools、tokenize;sys.argv[0]=“private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip install gccSRs/mysql python/setup.py”__文件“''/private/var/folders/1r/0z4”\u dp3j0237vqx1jvc0sn3c0000gp/T/pip install gccSRs/mysql python/setup.py''”;f=getattr(标记化,“'open'”,open)(\uuuuu文件);code=f.read().replace(“\r\n”“”、“\n”“”);f、 close();exec(compile(compile)(code,uuu file,uuuuu,“'exec’”)'install--record/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-record-PZ6DCs/install-record.txt--外部管理的单一版本--编译--install headers/Users/eskimi/Development/ErpNext/frappe bench/env/include/site/python2.7/mysql-python
cwd:/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip安装gccSRs/mysql python/
完整输出(41行):
正在运行的安装
运行构建
运行build\u py
创建构建
创建build/lib.macosx-10.14-intel-2.7
正在复制_mysql_exceptions.py->build/lib.macosx-10.14-intel-2.7
创建build/lib.macosx-10.14-intel-2.7/MySQLdb
正在复制MySQLdb/uuuu init_uuuuu.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
复制MySQLdb/converters.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
正在复制MySQLdb/connections.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
复制MySQLdb/cursors.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
正在复制MySQLdb/release.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
正在复制MySQLdb/times.py->build/lib.macosx-10.14-intel-2.7/MySQLdb
创建build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
正在复制MySQLdb/constants/\uuuuu init\uuuuuu.py->build/lib.mac