An error occurred while installing mysql-connector in python,
Windows 7 Environment
1. Go to the command line and execute the following command:
C: \ Users \ Administrator>Pip install mysql-connector
Note: The installation and download are slow and fail directly. The speed of VPN installation is faster, but an error is reported after the download is complete.
Collecting mysql-connector
Using cached mysql-connector-2.2.3.zip
Installing collected packages: mysql-connector
Running setup. py install for mysql-connector... error
Complete output from command "c: \ program files \ python36 \ python.exe"-u-c "I
Mport setuptools, tokenize ;__ file __= 'C: \ Users \ ADMINI ~ 1 \ AppData \ Local \ Temp \\
Pip-build-4wy1t6ee \ mysql-connector \ setup. py '; f = getattr (tokenize, 'open', open)
(_ File _); code = f. read (). replace ('\ r \ n',' \ n'); f. close (); exec (compile (code, _ fi
Le __, 'exec ') "install -- record C: \ Users \ ADMINI ~ 1 \ AppData \ Local \ Temp \ pip-4ft9q _
7k-record \ install-record.txt -- single-version-externally-managed -- compile:
Running install
Not Installing MySQL C Extension
Running build
Running build_py
Creating build
Creating build \ lib. win-amd64-3.6
Creating build \ lib. win-amd64-3.6 \ mysql
Copying lib \ mysql \ __init _. py-> build \ lib. win-amd64-3.6 \ mysql
Creating build \ lib. win-amd64-3.6 \ mysql \ connector
Copying lib \ mysql \ connector \ abstracts. py-> build \ lib. win-amd64-3.6 \ mysql \ co
Nnector
Copying lib \ mysql \ connector \ authentication. py-> build \ lib. win-amd64-3.6 \ mys
Ql \ connector
Copying lib \ mysql \ connector \ catch23.py-> build \ lib. win-amd64-3.6 \ mysql \ conn
Ector
Copying lib \ mysql \ connector \ charsets. py-> build \ lib. win-amd64-3.6 \ mysql \ con
Nector
Copying lib \ mysql \ connector \ connection. py-> build \ lib. win-amd64-3.6 \ mysql \ c
Onnector
Copying lib \ mysql \ connector \ connection_cext.py-> build \ lib. win-amd64-3.6 \ my
SQL \ connector
Copying lib \ mysql \ connector \ constants. py-> build \ lib. win-amd64-3.6 \ mysql \ co
Nnector
Copying lib \ mysql \ connector \ conversion. py-> build \ lib. win-amd64-3.6 \ mysql \ c
Onnector
Copying lib \ mysql \ connector \ cursor. py-> build \ lib. win-amd64-3.6 \ mysql \ conne
Ctor
Copying lib \ mysql \ connector \ cursor_cext.py-> build \ lib. win-amd64-3.6 \ mysql \
Connector
Copying lib \ mysql \ connector \ custom_types.py-> build \ lib. win-amd64-3.6 \ mysql
\ Connector
Copying lib \ mysql \ connector \ dbapi. py-> build \ lib. win-amd64-3.6 \ mysql \ connec
Tor
Copying lib \ mysql \ connector \ errorcode. py-> build \ lib. win-amd64-3.6 \ mysql \ co
Nnector
Copying lib \ mysql \ connector \ errors. py-> build \ lib. win-amd64-3.6 \ mysql \ conne
Ctor
Copying lib \ mysql \ connector \ network. py-> build \ lib. win-amd64-3.6 \ mysql \ conn
Ector
Copying lib \ mysql \ connector \ optionfiles. py-> build \ lib. win-amd64-3.6 \ mysql \
Connector
Copying lib \ mysql \ connector \ pooling. py-> build \ lib. win-amd64-3.6 \ mysql \ conn
Ector
Copying lib \ mysql \ connector \ protocol. py-> build \ lib. win-amd64-3.6 \ mysql \ con
Nector
Copying lib \ mysql \ connector \ utils. py-> build \ lib. win-amd64-3.6 \ mysql \ connec
Tor
Copying lib \ mysql \ connector \ version. py-> build \ lib. win-amd64-3.6 \ mysql \ conn
Ector
Copying lib \ mysql \ connector \__ init _. py-> build \ lib. win-amd64-3.6 \ mysql \ con
Nector
Creating build \ lib. win-amd64-3.6 \ mysql \ connector \ locales
Copying lib \ mysql \ connector \ locales \__ init _. py-> build \ lib. win-amd64-3.6 \ m
Ysql \ connector \ locales
Creating build \ lib. win-amd64-3.6 \ mysql \ connector \ locales \ eng
Copying lib \ mysql \ connector \ locales \ eng \ client_error.py-> build \ lib. win-amd
64-3.6 \ mysql \ connector \ locales \ eng
Copying lib \ mysql \ connector \ locales \ eng \ __init _. py-> build \ lib. win-amd64-3
. 6 \ mysql \ connector \ locales \ eng
Creating build \ lib. win-amd64-3.6 \ mysql \ connector \ django
Copying lib \ mysql \ connector \ django \ base. py-> build \ lib. win-amd64-3.6 \ mysql \
Connector \ django
Copying lib \ mysql \ connector \ django \ client. py-> build \ lib. win-amd64-3.6 \ mysq
L \ connector \ django
Copying lib \ mysql \ connector \ django \ compiler. py-> build \ lib. win-amd64-3.6 \ my
SQL \ connector \ django
Copying lib \ mysql \ connector \ django \ creation. py-> build \ lib. win-amd64-3.6 \ my
SQL \ connector \ django
Copying lib \ mysql \ connector \ django \ features. py-> build \ lib. win-amd64-3.6 \ my
SQL \ connector \ django
Copying lib \ mysql \ connector \ django \ introspection. py-> build \ lib. win-amd64-3
. 6 \ mysql \ connector \ django
Copying lib \ mysql \ connector \ django \ operations. py-> build \ lib. win-amd64-3.6 \
Mysql \ connector \ django
Copying lib \ mysql \ connector \ django \ schema. py-> build \ lib. win-amd64-3.6 \ mysq
L \ connector \ django
Copying lib \ mysql \ connector \ django \ validation. py-> build \ lib. win-amd64-3.6 \
Mysql \ connector \ django
Copying lib \ mysql \ connector \ django \ __init _. py-> build \ lib. win-amd64-3.6 \ my
SQL \ connector \ django
Creating build \ lib. win-amd64-3.6 \ mysql \ connector \ fabric
Copying lib \ mysql \ connector \ fabric \ balancing. py-> build \ lib. win-amd64-3.6 \ m
Ysql \ connector \ fabric
Copying lib \ mysql \ connector \ fabric \ caching. py-> build \ lib. win-amd64-3.6 \ mys
Ql \ connector \ fabric
Copying lib \ mysql \ connector \ fabric \ connection. py-> build \ lib. win-amd64-3.6 \
Mysql \ connector \ fabric
Copying lib \ mysql \ connector \ fabric \__ init _. py-> build \ lib. win-amd64-3.6 \ my
SQL \ connector \ fabric
Creating build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ authentication. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ charsets. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ compat. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ connection. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ constants. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ crud. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ dbdoc. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ errorcode. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ errors. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ expr. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ protobuf. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ protocol. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ result. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \ statement. py-> build \ lib. win-amd64-3.6 \ mysqlx
Copying lib \ mysqlx \__ init _. py-> build \ lib. win-amd64-3.6 \ mysqlx
Creating build \ lib. win-amd64-3.6 \ mysqlx \ locales
Copying lib \ mysqlx \ locales \__ init _. py-> build \ lib. win-amd64-3.6 \ mysqlx \ loc
Ales
Creating build \ lib. win-amd64-3.6 \ mysqlx \ locales \ eng
Copying lib \ mysqlx \ locales \ eng \ client_error.py-> build \ lib. win-amd64-3.6 \ my
Sqlx \ locales \ eng
Copying lib \ mysqlx \ locales \ eng \ __init _. py-> build \ lib. win-amd64-3.6 \ mysqlx
\ Locales \ eng
Running build_ext
# Python architecture: 64-bit
# Python ARCH_64BIT: True
Unable to find Protobuf include directory.
----------------------------------------
Command "" c: \ program files \ python36 \ python.exe "-u-c" import setuptools, tokeni
Ze ;__ file __= 'C: \ Users \ ADMINI ~ 1 \ AppData \ Local \ Temp \ pip-build-4wy1t6ee \ mysq
L-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 C: \ Users \ ADMINI ~ 1 \ AppData \ Local \ Temp \ pip-4ft9q_7k-record \ install-record
. Txt -- single-version-externally-managed -- compile "failed with error code 1 in
C: \ Users \ ADMINI ~ 1 \ AppData \ Local \ Temp \ pip-build-4wy1t6ee \ mysql-connector \
2. Use the old version for installation.
C: \ Users \ Administrator>Pip install mysql-connector = 2.1.4 (install the old version by specifying the old version number)
Collecting mysql-connector = 2.1.4
Downloading mysql-connector-2.1.4.zip (355kB)
...
B 19kB/s
Installing collected packages: mysql-connector
Running setup. py install for mysql-connector... done
Successfully installed mysql-connector-2.1.4
3. It is unclear how to install the new version.
Reference: http://www.cnblogs.com/JiangLe/p/6971134.html