代码之家  ›  专栏  ›  技术社区  ›  Dariush

无法在Raspberry Pi上的Python 3.6上安装基于C的模块,如lxml和Cython

  •  1
  • Dariush  · 技术社区  · 7 年前

    我从源代码构建了Python 3.6,正在尝试安装lxml。尝试从pip安装时会出现以下错误:

        gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -Isrc -Isrc/lxml/includes -I/usr/local/include/python3.6m -c src/lxml/etree.c -o build/temp.linux-armv6l-3.6/src/lxml/etree.o -w
        src/lxml/etree.c:91:20: fatal error: Python.h: No such file or directory
        compilation terminated.
        Compile failed: command 'gcc' failed with exit status 1
        cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitln68cjsn.c -o tmp/xmlXPathInitln68cjsn.o
        cc tmp/xmlXPathInitln68cjsn.o -L/usr/lib -lxml2 -o a.out
        error: command 'gcc' failed with exit status 1
    

    deb http://ftp.de.debian.org/debian sid main 
    

    但是,当我后来尝试安装它时,我收到以下错误:

    The following packages have unmet dependencies:
     libdbus-1-3 : Breaks: dbus (< 1.9.16-1~) but 1.6.8-1+deb7u1 is to be installed
    E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
    

    事实上,在Debian存储库中找到的任何包(不在Raspbian存储库中)都会出现此错误。我该怎么办?

    1 回复  |  直到 7 年前
        1
  •  1
  •   danny    7 年前

    任何一个

    • 将源代码目录添加到GCC使用的includes( gcc -I<dir>
    • 在自动包含的系统目录中安装from-source包,如 /usr/include /usr/local/include