查看: 1814|回复: 3

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

[复制链接]

3

主题

31

帖子

83

积分

注册会员

Rank: 2

积分
83
发表于 2018-9-19 09:31:50 | 显示全部楼层 |阅读模式
这是我的错误:
  1. (mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install lxml
  2. Downloading/unpacking lxml
  3.   Running setup.py egg_info for package lxml
  4.     Building lxml version 2.3.
  5.     Building without Cython.
  6.     ERROR: /bin/sh: xslt-config: not found

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

  8.     Using build configuration of libxslt
  9. Installing collected packages: lxml
  10.   Running setup.py install for lxml
  11.     Building lxml version 2.3.
  12.     Building without Cython.
  13.     ERROR: /bin/sh: xslt-config: not found

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

  15.     Using build configuration of libxslt
  16.     building 'lxml.etree' extension
  17.     gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.6/src/lxml/lxml.etree.o -w
  18.     src/lxml/lxml.etree.c:4: fatal error: Python.h: There is no file or directory
  19.     compilation terminated.
  20.     error: command 'gcc' failed with exit status 1
  21.     Complete output from command /home/zjm1126/zjm_test/mysite/bin/python -c "import setuptools;__file__='/home/zjm1126/zjm_test/mysite/build/lxml/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-jOhgvD-record/install-record.txt --install-headers /home/zjm1126/zjm_test/mysite/include/site/python2.6:
  22.     Building lxml version 2.3.

  23. Building without Cython.

  24. ERROR: /bin/sh: xslt-config: not found



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



  26. Using build configuration of libxslt

  27. running install

  28. running build

  29. running build_py

  30. running build_ext

  31. building 'lxml.etree' extension

  32. gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.6/src/lxml/lxml.etree.o -w

  33. src/lxml/lxml.etree.c:4: fatal error: Python.h: 没有那个文件或目录

  34. compilation terminated.

  35. error: command 'gcc' failed with exit status 1

  36. ----------------------------------------
  37. Command /home/zjm1126/zjm_test/mysite/bin/python -c "import setuptools;__file__='/home/zjm1126/zjm_test/mysite/build/lxml/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-jOhgvD-record/install-record.txt --install-headers /home/zjm1126/zjm_test/mysite/include/site/python2.6 failed with error code 1
  38. Storing complete log in /home/zjm1126/.pip/pip.log
复制代码

怎么搞?
回复

使用道具 举报

4

主题

37

帖子

98

积分

注册会员

Rank: 2

积分
98
发表于 2018-9-19 09:32:54 | 显示全部楼层
**确保安装了libxml2和libxslt的开发包**
假设你的操作系统是基于Debian的发行版
sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev
如果你在基于Debian的发行版上安装Python 3,那么您也需要安装python3-dev
回复

使用道具 举报

22

主题

107

帖子

266

积分

中级会员

Rank: 3Rank: 3

积分
266
发表于 2018-9-19 09:33:40 | 显示全部楼层
试试这个:
yum install libxslt-devel libxml2-devel
回复

使用道具 举报

15

主题

97

帖子

310

积分

论坛管理

Rank: 4

积分
310
发表于 2018-9-19 09:34:12 | 显示全部楼层
如果您使用的是Ubuntu / Lubuntu 13.04或Ubuntu 13.10并且遇到“/ usr / bin / ld:找不到-lz”的问题,您可能还需要安装zlib1g-dev软件包:
sudo apt-get install -y zlib1g-dev
把它们放在一起:
sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip
sudo pip3 install lxml
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表