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. 《操作系统真象还原》BIOS

    以下是读本书第二章的收获. 记得我大学学习操作系统的时候会遇到一些奇奇怪怪的问题,因为觉得问题太奇怪了,所以羞于问老师.诸如ROM到底是个什么东西:如果用内存映射的方式访问外部设备,是不是内存条里专门 ...

  2. 2019-08-25 纪中NOIP模拟A组

    T1 [JZOJ6314] Balancing Inversions 题目描述 Bessie 和 Elsie 在一个长为 2N 的布尔数组 A 上玩游戏. Bessie 的分数为 A 的前一半的逆序对 ...

  3. 仿ios按钮切换

    <div> <label><input class="btn-switch" type="checkbox"> 默认未选中& ...

  4. scala-匹配序列和元组

    scala的模式匹配极其强大,其中有一种用法是用case语句匹配序列和元组. 放码过来: def parse(x: Any): String = x match { case List(0, _, _ ...

  5. Navicat Premium怎么设置字段的唯一性(UNIQUE)?

    参考链接:https://blog.csdn.net/Song_JiangTao/article/details/82192189 1.打开你想要设计的表 这里写图片描述2.清楚你想要设计哪个字段为唯 ...

  6. 记录 Docker 的学习过程 (网络篇之跨主机互通)

    下面从node3上操作node3# docker run -d -p 8500:8500 --name consul progrium/consul -server -bootstrap node3# ...

  7. [国家集训队] 拉拉队排练 - Manacher

    用 Manacher 跑出回文串长,注意这里不需要偶数长度所以不需要对串做一些奇怪的处理 然后用前缀和搞一下,计算答案时跑快速幂即可 #include <bits/stdc++.h> us ...

  8. MarkDown图文编辑系列教程(一)

    MarkDown图文编辑系列教程(一) 一.写在前面 引言 如果你想作为博主发帖,markdown语法是你的基础操作.本教程分为三个部分,大体为基础操作与进阶操作(公式编辑).本篇为第一部分,对基础操 ...

  9. PTA-1003 我要通过!

    1003 我要通过!https://pintia.cn/problem-sets/994805260223102976/problems/994805323154440192 “答案正确”是自动判题系 ...

  10. C++-POJ1995-Raising Modulo Numbers[快速幂]

    #include <cstdio> typedef long long ll; int quick_pow(ll a,ll b,ll mod){ ll ans=; ))ans=(ans*a ...