一、MySQL Connector/Python 2.2.3 的变化:
之前 mysql 官方说MySQL Connector/Python 是纯python语言写的,但是呢! 这个问题在2.2.3中变天了;
以下是MySQL Connector/Python 2.2.3 是变更记录
Changes in MySQL Connector/Python 2.2.3 (2017-03-22)Functionality Added or ChangedBugs FixedFunctionality Added or ChangedThe pure Python implemention of Protobuf has been replaced by a C++ extension. This enables Connector/Python to support Python 2 and 3 as well as Protobuf 2 and 3. (Bug #25209469)Connector/Python now supports IPv6 target hosts in X DevAPI connection strings.
二、它带来了什么问题:
pip3.6 install mysql-connector # 安装不上mysql-connector 了 我的mac上没有这个依赖 Collecting mysql-connectorUsing cached mysql-connector-2.2.3.zip Installing collected packages: mysql-connectorRunning setup.py install for mysql-connector ... errorComplete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/bt/zvnw3lzj0j138lgvj21x728h0000gn/T/pip-build-5ozhefl4/mysql-connector/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/bt/zvnw3lzj0j138lgvj21x728h0000gn/T/pip-hx174vot-record/install-record.txt --single-version-externally-managed --compile:running installNot Installing MySQL C Extensionrunning buildrunning build_pycreating buildcreating build/lib.macosx-10.6-intel-3.6creating build/lib.macosx-10.6-intel-3.6/mysqlcopying lib/mysql/__init__.py -> build/lib.macosx-10.6-intel-3.6/mysqlcreating build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/__init__.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/abstracts.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/authentication.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/catch23.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/charsets.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/connection.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/connection_cext.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/constants.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/conversion.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/cursor.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/cursor_cext.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/custom_types.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/dbapi.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/errorcode.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/errors.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/network.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/optionfiles.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/pooling.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/protocol.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/utils.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcopying lib/mysql/connector/version.py -> build/lib.macosx-10.6-intel-3.6/mysql/connectorcreating build/lib.macosx-10.6-intel-3.6/mysql/connector/localescopying lib/mysql/connector/locales/__init__.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/localescreating build/lib.macosx-10.6-intel-3.6/mysql/connector/locales/engcopying lib/mysql/connector/locales/eng/__init__.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/locales/engcopying lib/mysql/connector/locales/eng/client_error.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/locales/engcreating build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocopying lib/mysql/connector/django/__init__.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocopying lib/mysql/connector/django/base.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocopying lib/mysql/connector/django/client.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocopying lib/mysql/connector/django/compiler.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocopying lib/mysql/connector/django/creation.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocopying lib/mysql/connector/django/features.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocopying lib/mysql/connector/django/introspection.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocopying lib/mysql/connector/django/operations.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocopying lib/mysql/connector/django/schema.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocopying lib/mysql/connector/django/validation.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/djangocreating build/lib.macosx-10.6-intel-3.6/mysql/connector/fabriccopying lib/mysql/connector/fabric/__init__.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/fabriccopying lib/mysql/connector/fabric/balancing.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/fabriccopying lib/mysql/connector/fabric/caching.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/fabriccopying lib/mysql/connector/fabric/connection.py -> build/lib.macosx-10.6-intel-3.6/mysql/connector/fabriccreating build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/__init__.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/authentication.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/charsets.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/compat.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/connection.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/constants.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/crud.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/dbdoc.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/errorcode.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/errors.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/expr.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/protobuf.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/protocol.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/result.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcopying lib/mysqlx/statement.py -> build/lib.macosx-10.6-intel-3.6/mysqlxcreating build/lib.macosx-10.6-intel-3.6/mysqlx/localescopying lib/mysqlx/locales/__init__.py -> build/lib.macosx-10.6-intel-3.6/mysqlx/localescreating build/lib.macosx-10.6-intel-3.6/mysqlx/locales/engcopying lib/mysqlx/locales/eng/__init__.py -> build/lib.macosx-10.6-intel-3.6/mysqlx/locales/engcopying lib/mysqlx/locales/eng/client_error.py -> build/lib.macosx-10.6-intel-3.6/mysqlx/locales/engrunning build_ext# Python architecture: 64-bit# Python ARCH_64BIT: TrueUnable to find Protobuf include directory.---------------------------------------- Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/bt/zvnw3lzj0j138lgvj21x728h0000gn/T/pip-build-5ozhefl4/mysql-connector/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/bt/zvnw3lzj0j138lgvj21x728h0000gn/T/pip-hx174vot-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/bt/zvnw3lzj0j138lgvj21x728h0000gn/T/pip-build-5ozhefl4/mysql-connector/
三、不行啦、我还是安装老版本的吧:
pip3.6 install mysql-connector==2.1.4 Collecting mysql-connector==2.1.4Downloading mysql-connector-2.1.4.zip (355kB)100% |████████████████████████████████| 358kB 1.2MB/s Installing collected packages: mysql-connectorRunning setup.py install for mysql-connector ... done Successfully installed mysql-connector-2.1.4
四、怎么样才能安装上最新版呢?:
----
学习交流