pip install MySQL-python 报错

pip install MySQL-python
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, . Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Collecting MySQL-python
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip (108kB)
|████████████████████████████████| 112kB .4MB/s
ERROR: Complete output from command python setup.py egg_info:
ERROR: sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line , in <module>
File "/tmp/pip-install-kfRwp2/MySQL-python/setup.py", line , in <module>
metadata, options = get_config()
File "setup_posix.py", line , in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line , in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code in /tmp/pip-install-kfRwp2/MySQL-python/
WARNING: You are using pip version 19.1., however version 19.3. is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

网上看需要安装python-devel mysql-devel 等

尝试 yum install python-devel mysql-devel ,mysql-devel有依赖问题,有如下报错

---> Package libss.x86_64 :1.42.-.el7 will be an update
Removing mariadb-libs.x86_64 :5.5.-.el7 - u due to obsoletes from installed mysql-community-libs-5.6.-.el7.x86_64
base//x86_64/filelists_db | 7.3 MB ::
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package mariadb-libs.x86_64 :5.5.-.el7 will be installed
--> Processing Dependency: mariadb-libs(x86-) = :5.5.-.el7 for package: :mariadb-devel-5.5.-.el7.x86_64
--> Finished Dependency Resolution
Error: Package: :mariadb-devel-5.5.-.el7.x86_64 (base)
Requires: mariadb-libs(x86-) = :5.5.-.el7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

网上的建议是直接去mysql官网下载对应版本的MySQL-devel

上传rpm包MySQL-devel-5.6.46-1.el7.x86_64.rpm到服务器,之后通过命令安装mysql-devel

yum install MySQL-devel-5.6.-.el7.x86_64.rpm -y

之后跑pip install MySQL-python 还有报错, 看了报错,好像还得需要一个MySQL-python

yum install MySQL-python -y

之后运行pip install MySQL-python成功

总结:

下次安装的时候先运行如下,试试,有报错,再查看

yum install python-devel mysql-devel zlib zlib-devel openssl-devel MySQL-python -y 

pip install MySQL-python

centos 7 pip install MySQL-python 报错的更多相关文章

  1. pip install cv2 安装报错

    pip install cv2 安装报错是一个常见现象: ERROR: Could not find a version that satisfies the requirement cv2 (fro ...

  2. python pip install XXX出现报错问题

    重装Anacondas后,将pip 和python.exe路径加入到环境变量后直接在cmd窗口进行pip 操作,报错如下 报错内容为: pip is configured with locations ...

  3. Python3.6.2安装pip install paramike模块报错

    问题描述: 在有几台电脑上pip install paramike报错 报错内容: Could not find a version that satisfies the requirement sq ...

  4. centos安装pip,zipimport.ZipImportError报错

    安装pip下载pip安装包wget https://bootstrap.pypa.io/get-pip.py 执行以下报错 python get-pip.py ##报错内容(zipimport.Zip ...

  5. pip install selenium==版本号 报错

    安装selenium是注意不要带版本号直接用如下命令: pip install selenium

  6. pip install urllib3[secure] 报错 error: ffi.h: No such file or directory

    解决 sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging pyt ...

  7. python 3.5.2安装mysql驱动报错

    python 3.5.2安装mysql驱动报错 python 3.5.2安装mysql驱动时出现如下异常: [root@localhost www]# pip install mysql-connec ...

  8. mysql select 报错

    代码片段: sql_url = "select * from webpage where url = '%s'" % b try: cursor.execute(sql_url) ...

  9. Python报错module 'scipy.misc' has no attribute 'xxx'

    Python报错module 'scipy.misc' has no attribute 'imresize' 解决办法: 安装Pillow包,命令如下: pip install Pillow 然后重 ...

随机推荐

  1. html无卡顿动画实现——requestAnimationFrame

    <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> ...

  2. LeetCode 237. 删除链表中的节点 (单链表遍历)

    题目链接:https://leetcode-cn.com/problems/delete-node-in-a-linked-list/ 请编写一个函数,使其可以删除某个链表中给定的(非末尾)节点,你将 ...

  3. 04-SV连接设计和测试平台

    1.验证一个设计的步骤: 生成输入激励,捕捉输出响应,决定对错和进度 2.连接设计和测试平台 信号连接:SystemVerilog已经扩展了传统的reg类型,可以像wire那样用来连接模块,它的新名字 ...

  4. PHPMailer发送邮件遇坑小记

    一:phpmailer发送邮件成功了 数据库发送状态也更改 但是用户就是没收到邮件. 出现原因:发送邮件太多 导致邮箱服务器被腾讯封了 发送的邮件统统进入了邮件服务器的草稿箱里. 解决方案: 重新修改 ...

  5. 使用uni-app开发小程序,关于小程序更新后与用户本地不会及时更新解决办法

    1.原因分析 在小程序更新开发版本之后,用户本地并没有对之前版本的小程序进行删除,那么再进入小程序的时候的版本是不会发生变化的,这是由于发版是异步执行,因此新版本将会覆盖的比较慢,本质是小程序的启动方 ...

  6. js 弹窗插件

    toastr 参考 https://www.cnblogs.com/fu-yong/p/8609597.html prettyPhoto使用 参考

  7. MySql 中IFNULL、ISNULL、NULLIF用法(数据库判空)

    来源:http://blog.csdn.net/a466350665/article/details/52994761 http://blog.csdn.net/xingyu0806/article/ ...

  8. jqgrid中分页和搜索,jqgrid loadonce:true后trigger("reloadGrid")无效

      第一次接触jqgrid,发现项目中好多地方都用到.   jqgrid是典型的B/S架构(浏览器/服务器模式),服务器端只需提供数据管理,浏览器只需负责数据显示.   jqGrid是用ajax实现对 ...

  9. 开放系统互联(OSI)模型

    开放系统互联(OSI)模型 是由国际标准化组织(ISO)于1984年提出的一种标准参考模型,是一种关于由不同供应商提供的不同设备和应用软件之间的网络通信的概念性框架结构.它被公认为是计算机通信和 in ...

  10. orm 相关

    优化