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. 剑指offer 14. 链表中倒数第 k 个结点

    14. 链表中倒数第 k 个结点 题目描述 输入一个链表,输出该链表中倒数第k个结点 法一:快慢指针 快指针先走 k 步,等快指针到达尾部时,慢指针所指结点即是倒数第 k 个结点 public cla ...

  2. IntelliJ Pycharm 2019年最新版 安装激活教程【最强,可用至2089、2100年】

    本文为2019年Pycharm最新版安装永久激活教程 PyCharm 2019.3 (Professional Edition) ①IntelliJ Pycharm 2019.3安装永久破解[最强] ...

  3. PAT - A1073

    1073 Scientific Notation (20point(s)) 小数点移动的边界条件 小数点左移 超过数据左边界 小数点右移 未超过数据右边界 超过数据右边界 +0.1E+2 --> ...

  4. CSS隐藏元素的五种方法

    1.opacity:0 2.visibility:hidden 3.diaplay:none 4.position:absolute display display属性依照词义真正隐藏元素.将disp ...

  5. java8的ConcurrentHashMap为何放弃分段锁,为什么要使用CAS+Synchronized取代Segment+ReentrantLock

    原文地址:https://cloud.tencent.com/developer/article/1509556 推荐一篇 ConcurrentHashMap 和 HashMap 写的比较的的文章 j ...

  6. php文件上传 form表单形式

    1.php界面 <?php header( 'Content-Type:text/html;charset=utf-8 ');include_once("conn/conn.php&q ...

  7. [CQOI2015] 网络吞吐量 - 最大流,最短路

    在第i个点只能选A[i]次的情况下,能选出多少条1-n的最短路 Solution 我们造出最短路DAG,然后对每个点拆点限流,跑最大流即可 双向边警告!(有悖直觉 #include <bits/ ...

  8. Codeforces 383C Propagating tree, 线段树, 黑白染色思想

    按深度染色,奇深度的点存反权值. #include <bits/stdc++.h> using namespace std; vector <]; ],a[],s[],vis[],i ...

  9. 解决laravel 429请求错误

    429 Too Many Requests(过多请求) 用户在在指定的时间里发送了太多的请求.用于限制速率. 这是laravel的api访问频率 找出throttle  这个中间件,注释掉.429问题 ...

  10. MapReduce异常:java.lang.ClassCastException: interface javax.xml.soap.Text

    MapReduce异常:java.lang.ClassCastException: interface javax.xml.soap.Text java.lang.ClassCastException ...