pip install mysql-connector 安装出错

一、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

 

四、怎么样才能安装上最新版呢?

 

 

 

 

 

----

学习交流

转载于:https://www.cnblogs.com/JiangLe/p/6971134.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/283407.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

2022世界传感器大会 | 龙芯中科发布龙芯2K0500多功能SoC芯片及解决方案

8月21日,由工业和信息化部、中国科学技术协会、河南省人民政府共同主办的2022世界传感器大会在郑州开幕,众多诺奖、图灵奖获得者、海内外院士和专家学者出席,全球传感器领域最具影响力的相关企业参加。龙芯中科董事长胡伟武在大会开幕式发表主…

Vue3 配置config文件,打包后随意修改配置,无需重新打包和重启

在public目录创建config.json文件,名字随便起。 {"AppVersion": "1.0","AppTitle": "这里是程序名称" } 修改AppTitle: {"AppVersion": "1.0","AppTitle": "这里是修改后的…

在Vue3中使用Element Plus Icon图标的几种方式

安装 Element Plus $ npm install element-plus/icons在main.js 引入 import * as ElIcon from element-plus/icons-vueObject.keys(ElIcon).forEach((key) > {app.component(key, ElIcon[key]) }) 方式一&#xff1a;通过 icon"el-icon-plus" 使用 <!-- …

Qt 打印机操作

2019独角兽企业重金招聘Python工程师标准>>> 配置文件加入打印机支持&#xff1a; QT printsupport 1、打印图片 打印图片所需头文件&#xff1a; #include <QPixmap> #include <QPrinter> #include <QPainter> 打印图片代码&#xff1a; QStrin…

spark集群详细搭建过程及遇到的问题解决(四)

在spark集群详细搭建过程及遇到的问题解决&#xff08;三&#xff09;中&#xff0c;我们将讲述了hadoop的安装过程&#xff0c;在本文中将主要讲述spark的安装配置过程。sparkmaster:~/spark$ cd hadoop sparkmaster:~/spark/hadoop$ cd $SPARK_HOME/conf sparkmaster:~/spark…

k8s 读书笔记 - 深入掌握 Pod

什么是 PodPod 是可以在 Kubernetes 中创建和管理的、最小的可部署的计算单元。在同一个 context 下&#xff0c;应用可能还会有独立的 cgroup 隔离机制&#xff0c;一个 Pod 是一个容器环境下的 “逻辑主机”。Pod 是一组容器单元&#xff0c; 这些容器共享存储、网络、以及怎…

Net core 报 Could not load file or assembly ‘System.Security.Permissions 错误

完整错误提示 System.IO.FileNotFoundException:“Could not load file or assembly System.Security.Permissions, Version4.0.3.0, Cultureneutral, PublicKeyTokencc7b13ffcd2ddd51. 系统找不到指定的文件。” 控制台 错误提示&#xff1a; 根据提示可知&#xff1a;这是由…

“芯”痛痛在系统与芯片 转型升级是历史趋势

2019独角兽企业重金招聘Python工程师标准>>> 4月23号&#xff0c;中共中央政治局召开会议&#xff0c;分析研究当前一系列经济工作形势&#xff0c;并且强调完成今年的目标任务&#xff0c;需要付出艰苦努力&#xff0c;关键是要同高质量发展的要求对表&#xff0c;…

如何让Vuex刷新页面数据不丢失?实现方法和原理 vuex-persistedstate 和 vuex-persist的使用

如题&#xff1a;由于vue自身特性的原因&#xff0c;vuex中的数据在页面刷新之后其中的数据会初始化&#xff0c;这就导致组件之间通过vuex传递的数据在用户f5刷新页面之后会丢失 页面刷新后&#xff0c;想保存页面未保存的数据。我们总是习惯于放在浏览器的sessionStorage和l…

linux系统中如何查看日志 (常用命令)

2019独角兽企业重金招聘Python工程师标准>>> linux系统中如何查看日志 (常用命令) cat tail -f 日 志 文 件 说 明 /var/log/message 系统启动后的信息和错误日志&#xff0c;是Red Hat Linux中最常用的日志之一 /var/log/secure 与安全相关的日志信息 /var/log/…

刚刚 Kubernetes 1.25 正式发布,所有变化都在这儿了

此版本带来了 40 项增强功能&#xff0c;略少于Kubernetes 1.24 中的 46 项。在这 40 项增强功能中&#xff0c;13 项正在升级到稳定版&#xff0c;10 项是对现有功能的不断改进&#xff0c;15 项是全新的&#xff0c;2 项是已弃用的功能。此版本的亮点是 PodSecurityPolicies …

vue经验 - 细节小知识点汇总(更新中...)

1. $refs 数据这么绑定的&#xff1a; 然后在created中抛出来&#xff0c;猜猜看看打印的是两个什么&#xff1f; 结果如下&#xff1a; 第一个跑出来了&#xff0c;第二个&#xff0c;却undefiend&#xff0c;没有东西&#xff1f;&#xff01;。。。 后来去官网查看$refs的解…

cf769D(枚举位或运算)

题目链接&#xff1a;http://codeforces.com/problemset/problem/769/D 题意&#xff1a;求给出的 n 个数中有多少对数字的二进制形式恰好有 k 位不同 思路&#xff1a;两个数a, b的二进制形式恰好 k 位不同即 a ^ b 中 1 的个数&#xff0c;那么可以枚举&#xff0e;注意 n 为…

ASP.NET Core 同时支持多种认证方式

前言上次&#xff0c;我们实现了《ASP.NET Core 自定义认证》&#xff1a;services.AddAuthentication(option > {option.DefaultAuthenticateScheme DemoAuthenticationOptions.Scheme;option.DefaultChallengeScheme DemoAuthenticationOptions.Scheme;}).AddDemoAuthen…

Linux shell 编程(七):流程控制语句

流程控制语句 在shell中如果在终端输入多个命令&#xff0c;如果以&分隔则将命令放入后台执行&#xff0c;如果以;分隔&#xff0c;则表示一个命令集合。shell允许使用逻辑操作符&&和||来作为命令分隔符&#xff0c;他们分别时AND和OR. && 如果前面命令执行…

多线程锁--怎么理解Condition

在java.util.concurrent包中&#xff0c;有两个很特殊的工具类&#xff0c;Condition和ReentrantLock,使用过的人都知道&#xff0c;ReentrantLock&#xff08;重入锁&#xff09;是jdk的concurrent包提供的一种独占锁的实现。它继承自Dong Lea的 AbstractQueuedSynchronizer&a…

.NET 8 SDK安装包可以下载了

今早在一个技术交流群看到有.NET 8的安装交流&#xff0c;站长下载了&#xff0c;把安装过程记录了&#xff0c;总结是&#xff1a;目前还无法 正常使用 .NET 8 SDK&#xff0c;虽然可以正常下载、安装&#xff0c;但宇宙第一IDE VS还尚未支持&#xff0c;也许站长打开方式不对…

VUE3中实现word的预览功能

安装docx-preview cnpm i docx-preview --save 在vue文件中使用 <div ref"refWord" v-if"showType word" /> <script setup name"ResPreviewBox">import { ref } from vue import { httpGet, httpGetBlob } from ../utils/requ…

VUE3+pdfh5实现预览Pdf文件

安装插件 npm install pdfh5 使用 <template><el-container class"resPreview"><div ref"refPdf"/></el-container> </template><script setup name"PreviewBox">import { ref } from vue import { http…

TODO:从数据库中随机抽取一条记录

TODO&#xff1a;从数据库中随机抽取一条记录1.最直接&#xff0c;最粗暴的方法先计算记录的总数&#xff0c;然后选择一个从0到记录总数之间的随机数n&#xff0c;利用skip跳过n条记录&#xff0c;这是效率低下的的方法&#xff0c;首先的记录总数&#xff0c;在用skip会很耗时…