Linux安装mysql-python库时报错解决办法

用pip安装mysql-python库的时候遇到如下报错

[email protected]:~# pip install mysql-python
Collecting mysql-python
  Using cached MySQL-python-1.2.5.zip
    Complete output from command python setup.py egg_info:
    sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-eLhjoy/mysql-python/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 43, in get_config
        libs = mysql_config("libs_r")
      File "setup_posix.py", line 25, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    EnvironmentError: mysql_config not found

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-eLhjoy/mysql-python/

安装libmysqlclient-dev

[email protected]:~# apt-get install libmysqlclient-dev

重新安装mysql-python库

[email protected]:~# pip install mysql-python
Collecting mysql-python
  Using cached MySQL-python-1.2.5.zip
Building wheels for collected packages: mysql-python
  Running setup.py bdist_wheel for mysql-python ... done
  Stored in directory: /root/.cache/pip/wheels/38/a3/89/ec87e092cfb38450fc91a62562055231deb0049a029054dc62
Successfully built mysql-python
Installing collected packages: mysql-python
Successfully installed mysql-python-1.2.5

安装成功。

时间: 2024-10-07 22:57:20

Linux安装mysql-python库时报错解决办法的相关文章

编译安装PHP使用session_start()时报错&解决办法

系统上的PHP是编译安装的,在session_start()的时候报错! A 错误信息: Warning: session_start(): open(/var/lib/php/session/sess_qavhhacl7lrdbggauasf1qdlo5, O_RDWR) failed: No such file or directory (2) in /www/tool/classes/service/User.php on line 75 1Warning: Unknown: open(/

linux 编译安装php及编译安装mysql常见错误总结及解决办法

一.编译安装php常见错误总结及解决办法 错误 1checking for xml2-config path…configure: error: xml2-config not found. Please check your libxml2 installation.解决办法:# yum -y install libxml2-devel 错误 2 checking for BZip2 in default path… not foundconfigure: error: Please rein

阿里云安装mysql数据库出现2002错误解决办法

在安装数据库的时候出现了如下错误: 解决办法如下: 1.在bin目录下 输入:kill -s 9 9907 再输入:ps -ef|grep mysql 显示如下: 2.回到lampp目录下,重启数据库,服务器: 1.  ./lampp restart

vue2-preview引用时报错解决办法

1.报错信息 在完全按照官方文档安装引入vue2-preview时出现报错,报错信息如下: 从图中标记处可以知道出错是因为在\node_modules\[email protected]@vue2-preview\src\plugins\preview中找不到./photoswipe/dist/default-skin/default-skin.css这个文件所致的. 2.解决办法 在作者没有解决之前暂时修改插件,不知道有没有后续问题 进入到\node_modules\[email protec

docker删除镜像时报错解决办法

报错信息 [[email protected] ~]# docker rmi 4950a54ede5a Error response from daemon: conflict: unable to delete 4950a54ede5a (must be forced) - image is being used by stopped container 834789a17497 报错原因 image is being used by stopped container 834789a1749

scrapy框架编写向redis数据库中存储数据的相关代码时报错解决办法

错误信息:redis.exceptions.DataError: Invalid input of type: 'dict'. Convert to a byte, string or number first. 解决办法:python中redis包更新导致的问题,变更了srem方法的输入.使用旧版本pip install redis==2.10.6,即可解决 原文地址:https://www.cnblogs.com/lys666/p/10469981.html

四、安装Mysql中的问题及解决办法-----主要针对于前一篇博文可能出现的问题

在安装执行 $ rpm -ivh 5.MySQL-client-5.6.21-1.el6.x86_64.rpm 会发现,在安装Mysql时与原有数据库mariadb相冲,出错,不能安装 删除原数据库 $ rpm -e mariadb-libs-5.5.60-1.el7_5.x86_64 –nodeps 再安装 $ rpm -ivh 5.MySQL-client-5.6.21-1.el6.x86_64.rpm $ rpm -ivh 5.MySQL-server-5.6.21-1.el6.x86_6

eclipse创建maven项目时报错解决办法

1.Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the configured repositories. 办法:下载maven-archetype-quickstart-1.1.jar放入安装maven的lib文件夹下,在此处启动dos窗口输入命令:mvn install:install-file -DgroupId=org.apache.ma

在eclipse中使用git的pull功能时报错解决办法

打开项目的 .git/config文件,参照以下进行编辑 [core] symlinks = false repositoryformatversion = 0 filemode = false logallrefupdates = true [branch "master"] remote = origin merge = refs/heads/master [remote "origin"] url = https://github.com/用户名/项目名.gi