windows 7环境

1.进入命令行执行以下命令:

C:\Users\Administrator>pip install mysql-connector

注:安装下载较慢,直接失败,改用VPN安装速度加快,但下载完成后安装报错。

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.遂改用旧版本安装

C:\Users\Administrator>pip install mysql-connector==2.1.4  (通过指定旧版本号安装旧版本)
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.暂不清楚如何新版本如何安装

参考文档:http://www.cnblogs.com/JiangLe/p/6971134.html

python安装mysql-connector出错的更多相关文章

  1. Python:安装MYSQL Connector

    在Python中安装MySQL Connector有如下三种方法: 1.直接安装客户端[建议使用] pip install mysqlclient 2.安装mysql连接器 pip install - ...

  2. Python安装Mysql驱动出错解决(最新出炉)

    Python中最连接Mysql常用的驱动是 mysql-python :mysql的C语言的驱动 mysql-connector:msql官方的驱动 pymysql:python语言的驱动 我这里安装 ...

  3. Python安装MySQL数据库模块

    背景 折腾: [记录]使用Python操作MySQL数据库 的过程中,需要去安装MySQLdb. 下载MySQLdb 去官网: http://pypi.python.org/pypi/MySQL-py ...

  4. Ubuntu & MacOS安装Mysql & connector

    Ubuntu & MacOS安装Mysql & connector 1. 安装MySql sudo apt-get install mysql-server apt-get insta ...

  5. 安装MySQL Connector/C++并将其配置到VS2015中

    安装MySQL Connector/C++并将其配置到VS中 1.下载MySQL Connector/C++并安装 在下载地址:https://dev.mysql.com/downloads/conn ...

  6. python 安装mysql 客户端遇到的问题

    一. Win7 64位编译Python扩展解决”error: Unable to find vcvarsall.bat”问题   系统上安装有Visual Studio 2010以及相应的SDK,然后 ...

  7. [MySql] - 解决部署的服务器没有安装MySql Connector

    1. 在C盘安装mysql的位置找到三个DLL,复制到Bin文件夹下. 2. 在配置文件的web下添加引用,PubulishKeyToken 根据版本来. <system.data> &l ...

  8. python 安装mysql报错

    原 安装Python mysqlclient出现“OSError: mysql_config not found”错误 2016年06月01日 12:15:11 wangtaoking1 阅读数:11 ...

  9. python安装mysql

    一.MySQL是一种关系数据库管理系统,关系数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性. 二.最近在学习python语言,总体上面来说还是接触的挺快 ...

  10. Python 安装MySQL 错误处理

    正常情况下如果使用python 连接数据库需要安装 python-MySQL 类库 #pip install python-MySQL 等待安装完成即可 使用时 import MySQLdb ==== ...

随机推荐

  1. JS与JQ的对比与提高

    来吧, 案例1:先上个例子js写的省市二级联动 <!DOCTYPE html><html> <head> <meta charset="UTF-8& ...

  2. 第二十一篇 .NET高级技术之使用多线程(三)

    1.  单元模式和Windows Forms 单元模式线程是一个自动线程安全机制, 非常贴近于COM——Microsoft的遗留下的组件对象模型.尽管.NET最大地放弃摆脱了遗留下的模型,但很多时候它 ...

  3. C 语言实例 - 计算 int, float, double 和 char 字节大小

    C 语言实例 - 计算 int, float, double 和 char 字节大小 C 语言实例 C 语言实例 使用 sizeof 操作符计算int, float, double 和 char四种变 ...

  4. 可以提升3倍开发效率的 Intellij IDEA快捷键大全汇总(2019)

    整理了一下IDEA的常用快捷键,可以打印出来或者弄成图片设置为桌面,为广大的程序员们节省更多的时间去谈恋爱. 常用快捷键1 Ctrl+Shift + Enter,语句完成 “!”,否定完成,输入表达式 ...

  5. element-ui + el-dialog + Vue.component 注册的富文本控件 第二次及以后打开dialog出现问题解决方法

    自定控件 添加属性  v-if="dialogVisible" <el-dialog title="" :visible.sync="dialo ...

  6. 【Codeforces1111D_CF1111D】Destroy the Colony(退背包_组合数学)

    题目: Codeforces1111D 翻译: [已提交至洛谷CF1111D] 有一个恶棍的聚居地由几个排成一排的洞穴组成,每一个洞穴恰好住着一个恶棍. 每种聚居地的分配方案可以记作一个长为偶数的字符 ...

  7. Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) A

    Description There are literally dozens of snooker competitions held each year, and team Jinotega tri ...

  8. Spring的ioc(DI)复习概念和原理简介

    IOC的好处 ioc或者说di的概念很显然了,反转控制和依赖注入,那本来直接new就行的东西,为什么要搞这么复杂呢?? 开发维护方便,高层设计不用依赖底层的,不然底层一个类改下构造器,高层就全要改,因 ...

  9. 深入理解synchronized

    上一篇博客虽然题目叫内置锁的基本使用,但其实也是讲synchronized关键字的使用的.这篇博客是在看了许多大佬的博客记录后总结出的synchronized更底层的知识和原理. 一.synchron ...

  10. 083 Remove Duplicates from Sorted List 有序链表中删除重复的结点

    给定一个排序链表,删除所有重复的元素使得每个元素只留下一个.案例:给定 1->1->2,返回 1->2给定 1->1->2->3->3,返回 1->2- ...