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. 使用Python爬虫整理小说网资源-自学

    第一次接触python,原本C语言的习惯使得我还不是很适应python的语法风格.希望读者能够给出建议. 相关的入门指导来自以下的网址:https://blog.csdn.net/c406495762 ...

  2. CF566C Logistical Questions(10-1)

    题意 \(n\)个点的树,有点权,有边权,\(f(x)=\sum\limits_{i=1}^n w_idis(i,x)^{1.5}\),求最小的\(f(x)\)的\(x\) 单独考虑一条链,顺序编号, ...

  3. POJ1776(哈密顿路径)

    题目: http://poj.org/problem?id=1776 题意: 给出一个n*n的矩阵,若第i个任务做完之后可以做第j个任务,则矩阵的第i行第j列为1,否则为0.机器完成一项任务之后会自动 ...

  4. GYCTF Node game

    考点: NodeJS 代码审计 SSRF 请求夹带 复现: 不太懂js,先留着吧,学懂了再记录

  5. 获取redis实例中最大的top-N key

    需求:获取redis实例中最大的top-N key 说明:由于redis 4.x才引入了memory usage keyname的语法.3.x不支持! db_ip=5.5.5.101 db_port= ...

  6. The view or its master was not found or no view engine supports the searched locations

    Error like:The view 'LoginRegister' or its master was not found or no view engine supports the searc ...

  7. Aspx Ajax 调用 C#函数处理数据

    jquery ajax 调用后台函数 var res; $.ajax({ type: "POST", url: "fast_index_overview.aspx/Get ...

  8. django orm查询和后端缓存的使用

    django orm 查询 1 字段后(db_column='age') (null=True)#表示数据库里面的该字段数据可以为空 (blank=True)#表示前端表单提交的时候可以为空 (db_ ...

  9. CSS 自适应导航菜单

    文章目录 以前我写了一篇关于如何为自适应网页制作教程手机导航菜单,现在我又摸索出一种无需JS脚本的自适应导航菜单,它采用纯粹的语义化HTML5标签来完成.该菜单可以左对齐,居中或右对齐,也不像上一种方 ...

  10. promise是怎么来的?

    一.promise是如何产生的 1. promise并不是一个新的功能,它是一个类,它只是对 异步编程的代码进行整合,它是解决异步(层层嵌套的这种关系),让你的代码看起来更简洁. 2. 在 es6 中 ...