Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python raspberry pi无法安装lxml pip包_Python_Beautifulsoup_Raspberry Pi_Pip_Lxml - Fatal编程技术网

Python raspberry pi无法安装lxml pip包

Python raspberry pi无法安装lxml pip包,python,beautifulsoup,raspberry-pi,pip,lxml,Python,Beautifulsoup,Raspberry Pi,Pip,Lxml,在安装了BeautifulSoup4软件包之后,我正在尝试安装lxml软件包 在终端i类型中: sudo pip install lxml 这就是我得到的 sudo pip install lxml Downloading/unpacking lxml Running setup.py egg_info for package lxml Building lxml version 3.6.1. Building without Cython. Using build

在安装了
BeautifulSoup4
软件包之后,我正在尝试安装
lxml
软件包

在终端i类型中:

sudo pip install lxml
这就是我得到的

sudo pip install lxml
Downloading/unpacking lxml
  Running setup.py egg_info for package lxml
    Building lxml version 3.6.1.
    Building without Cython.
    Using build configuration of libxslt 1.1.26
    Building against libxml2/libxslt in the following directory: /usr/lib

Installing collected packages: lxml
  Running setup.py install for lxml
    Building lxml version 3.6.1.
    Building without Cython.
    Using build configuration of libxslt 1.1.26
    Building against libxml2/libxslt in the following directory: /usr/lib
    building 'lxml.etree' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-armv9l-2.7/src/lxml/lxml.etree.o -w
然后它在最后一行挂了很长时间,我必须按CTRL+C退出

有人能告诉我它的真正含义吗


然后我尝试
pip freeze
查看是否安装了该软件包。不,它不在那里。

您可以打开python并尝试导入它。但是如果是Python3,请尝试以下方法

sudo apt-get install python3-lxml
否则它

sudo apt-get install python-lxml

这意味着您所使用的设备的硬件非常有限,因此编译程序可能需要很长时间。如果你在编译过程中退出,它并没有被意外地安装。在我的Raspberry Pi上,编译器崩溃说:“ARM Linux GNUEABIHF GCC:内部编译器错误:被杀死(程序cc1)”可能是由于内存不足,我不知道(还)。.当我使用
pip
安装
lxml
时,我的树莓pi冻结了,但在使用
apt get
进行安装后,它工作了。非常感谢:)