问题0:

在安装 mysql-python时,会出现:

sh: mysql_config: not found
Traceback (most recent call last):
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "/home/zhxia/apps/source/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/home/zhxia/apps/source/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found

只要原因是没有安装:libmysqlclient-dev

sudo apt-get install libmysqlclient-dev

找到mysql_config文件的路径

sudo updatedb
locate mysql_config

mysql_config的位置为:/usr/bin/mysql_config

在mysql-python源码包下找到:setup_posix.py 文件,然后找到文件中的 mysql_config.path 将其值改为:/usr/bin/mysql_config,然后 sudo python setup.py install ,就ok了

问题1:

ERROR: /bin/sh: 1: xslt-config: not found

make sure the development packages of libxml2 and libxslt are installed **

参考:

http://stackoverflow.com/questions/5178416/pip-install-lxml-error

http://stackoverflow.com/questions/21489720/installing-pyquery-via-pip

解决:

apt-get install libxslt1-dev

问题2:

error: Setup script exited with error: command 'gcc' failed with exit status 1

通过安装如下库即可解决:

sudo apt-get install python-dev

pip install lxml mysql-python error的更多相关文章

  1. pip install lxml出错解决

    初学Python各种版本问题,安装pip install lxml各种出错,解决方法:py -2 -m pip install wheel(PY3上我上个帖子已经标了),http://www.lfd. ...

  2. Pip install lxml centOSFailed building wheel for lxml

    转到虚拟环境目录:yum install libxslt-devel libxml2-devel yum install python-devel pip install lxml

  3. Python: Win7下使用 pip install lxml 无法安装lxml?

    1.在网址 http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml 下,搜索lxml,下载Python对应的lxml版本.如下图: 2.打开cmd,进入到lxm ...

  4. pip install psycopg2出现python setup.py egg_info failed with error code 1 in /tmp/pip-build-YtLeN3/psycopg2错误处理

    折腾了一上午flask部署,到最后访问域名还是出现Application Error错误提示.估计是程序还有问题,想着直接clone书中作者的代码先试试能不能部署成功.结果在执行pip install ...

  5. 查看pip install安装的python包的位置

    例如,我在一个名为tf_14的vertualenv环境中(no-site-package)安装了一个contextlib2包 (tf_14) novak@novak-ZBook15G2:~/Carnd ...

  6. pip安装lxml报错 Fatal error in launcher: Unable to create process using '"c:\users\administrator\appdata\local\programs\python\python36\python.exe" "C:\Users\Administrator\AppData\L

    pip install lxml 安装报错 E:\apollo\spider_code>Fatal error in launcher: Unable to create process usi ...

  7. python pip install 报错TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' Command "python setup.py egg_info" failed with error code 1 in

    pip install http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp27-cp27mu-manylinux1_x86_64.whl ...

  8. Windows环境下使用pip install安装lxml库

    lxml是Python语言和XML以及HTML工作的功能最丰富和最容易使用的库.lxml是为libxml2和libxslt库的一个Python化的绑定.它与众不同的地方是它兼顾了这些库的速度和功能完整 ...

  9. python pip安装lxml失败(转)

    今天想要试试beautifulsoup4,安装的时候很顺利,然后就准备安装lxml作为解析器,没想到安装时pip直接给我报了一整页的错误. 解决过程 查看了一下错误提示,其中有如下一段: ****** ...

随机推荐

  1. vue监听不到props中的值时

    已解决: watch: { data: { immediate: true, handler: function(newVal) { console.log(newVal); } } },

  2. 关于svn插件突然失效问题

    这个分享一下 安装  MyBatisGenerator 插件 之后,svn失效,删掉mybatis 后,svn就恢复正常...这怎么割 一翻折腾无效,后来发现  MyBatisGenerator  和 ...

  3. js 继承介绍

    js中继承的方式并不是明确的,这里介绍常用的几种 一.对象冒充(构造函数绑定) 原理:使用对象冒充继承基类,实质上是使用call或apply方法改变this 指针的指向 function Monkey ...

  4. flush table with read lock的轻量级解决方案

    为什么要使用FTWRL   MySQL dba在日常工作中,数据备份绝对是工作频度最高的工作内容之一.当你使用逻辑方式进行备份(mydumper,mysqldump)或物理方式进行备份(percona ...

  5. 初学SpringMVC,使用MVC进行文件上传

    最近在做一个文件上传的功能,走了不少弯路,话不多说,直接上代码: 导入各种jar包,首先是applicationContext.xml配置文件中: <!-- 配置文件解析器 --> < ...

  6. JS实现一位数显示为两位

    使用js脚本实现页面一位数字显示为两位,不足两位前面加“0”. function fix(num, length) { return ('' + num).length < length ? ( ...

  7. Java学习--扑克牌比大小的小游戏

    实现:生成五十四张牌,然后进行洗牌,输入两名玩家,然后分别发两张牌,进行比较大小,两张牌中拥有较大一张牌的玩家获胜 Card.java代码如下: package com.cardgame; publi ...

  8. vue的简单测试

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. Django,COOKIES,SESSION完成用户登入

    1.urls.py """Django_cookie_session URL Configuration The `urlpatterns` list routes UR ...

  10. PHP在foreach中对$value赋值无效,应该用 ‘键’ 或者 &$value的形式

    首先我们看下这段代码: foreach ($data as$value) { $value['name'] = 'Hehe'; } $data中原始的数据为: array(1) { [0] => ...