Skip to main content
 首页 » 编程设计

python之fbchat Python库灌输错误

2025年02月15日13mfryf

抱歉阅读时间过长,在此先感谢您。我已经发布了 CMD 的所有输出,但我在最后解释了主要错误。

我正在尝试为我正在创建的虚拟助手程序安装 python 库 fbchat,但是,我在尝试将它安装到我的 Windows 10 电脑上时遇到了一些非常奇怪的问题。

下面是我的命令提示符的输出:

Microsoft Windows [Version 10.0.14393] 
(c) 2016 Microsoft Corporation. All rights reserved. 
 
C:\Users\lukec>pip install fbchat 
Requirement already satisfied: fbchat in c:\python27\lib\site-packages\fbchat-0.5.0-py2.7.egg 
Requirement already satisfied: requests in c:\python27\lib\site-packages (from fbchat) 
Collecting lxml (from fbchat) 
  Using cached lxml-3.7.1.tar.gz 
Requirement already satisfied: beautifulsoup4 in c:\python27\lib\site-packages\beautifulsoup4-4.5.1-py2.7.egg (from fbchat) 
Building wheels for collected packages: lxml 
  Running setup.py bdist_wheel for lxml ... error 
  Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\lukec\\appdata\\local\\temp\\pip-build-1ul2r3\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d c:\users\lukec\appdata\local\temp\tmpmna48rpip-wheel- --python-tag cp27: 
  Building lxml version 3.7.1. 
  Building without Cython. 
  ERROR: 'xslt-config' is not recognized as an internal or external command, 
  operable program or batch file. 
 
  ** make sure the development packages of libxml2 and libxslt are installed ** 
 
  Using build configuration of libxslt 
  running bdist_wheel 
  running build 
  running build_py 
  creating build 
  creating build\lib.win32-2.7 
  creating build\lib.win32-2.7\lxml 
  copying src\lxml\builder.py -> build\lib.win32-2.7\lxml 
  copying src\lxml\cssselect.py -> build\lib.win32-2.7\lxml 
  copying src\lxml\doctestcompare.py -> build\lib.win32-2.7\lxml 
  copying src\lxml\ElementInclude.py -> build\lib.win32-2.7\lxml 
  copying src\lxml\pyclasslookup.py -> build\lib.win32-2.7\lxml 
  copying src\lxml\sax.py -> build\lib.win32-2.7\lxml 
  copying src\lxml\usedoctest.py -> build\lib.win32-2.7\lxml 
  copying src\lxml\_elementpath.py -> build\lib.win32-2.7\lxml 
  copying src\lxml\__init__.py -> build\lib.win32-2.7\lxml 
  creating build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\__init__.py -> build\lib.win32-2.7\lxml\includes 
  creating build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\builder.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\clean.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\defs.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\diff.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\ElementSoup.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\formfill.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\html5parser.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\soupparser.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\usedoctest.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\_diffcommand.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\_html5builder.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\_setmixin.py -> build\lib.win32-2.7\lxml\html 
  copying src\lxml\html\__init__.py -> build\lib.win32-2.7\lxml\html 
  creating build\lib.win32-2.7\lxml\isoschematron 
  copying src\lxml\isoschematron\__init__.py -> build\lib.win32-2.7\lxml\isoschematron 
  copying src\lxml\lxml.etree.h -> build\lib.win32-2.7\lxml 
  copying src\lxml\lxml.etree_api.h -> build\lib.win32-2.7\lxml 
  copying src\lxml\includes\c14n.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\config.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\relaxng.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\schematron.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\tree.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\uri.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\xinclude.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\xpath.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\xslt.pxd -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\etree_defs.h -> build\lib.win32-2.7\lxml\includes 
  copying src\lxml\includes\lxml-version.h -> build\lib.win32-2.7\lxml\includes 
  creating build\lib.win32-2.7\lxml\isoschematron\resources 
  creating build\lib.win32-2.7\lxml\isoschematron\resources\rng 
  copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win32-2.7\lxml\isoschematron\resources\rng 
  creating build\lib.win32-2.7\lxml\isoschematron\resources\xsl 
  copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl 
  copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl 
  creating build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  running build_ext 
  building 'lxml.etree' extension 
  creating build\temp.win32-2.7 
  creating build\temp.win32-2.7\Release 
  creating build\temp.win32-2.7\Release\src 
  creating build\temp.win32-2.7\Release\src\lxml 
  C:\Users\lukec\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc\lxml\includes -Ic:\python27\include -Ic:\python27\PC /Tcsrc\lxml\lxml.etree.c /Fobuild\temp.win32-2.7\Release\src\lxml\lxml.etree.obj -w 
  cl : Command line warning D9025 : overriding '/W3' with '/w' 
  lxml.etree.c 
  src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory 
  Compile failed: command 'C:\\Users\\lukec\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2 
  creating users 
  creating users\lukec 
  creating users\lukec\appdata 
  creating users\lukec\appdata\local 
  creating users\lukec\appdata\local\temp 
  C:\Users\lukec\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/include/libxml2 /Tcc:\users\lukec\appdata\local\temp\xmlXPathInitzjpakr.c /Fousers\lukec\appdata\local\temp\xmlXPathInitzjpakr.obj 
  xmlXPathInitzjpakr.c 
  c:\users\lukec\appdata\local\temp\xmlXPathInitzjpakr.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory 
  ********************************************************************************* 
  Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? 
  ********************************************************************************* 
  error: command 'C:\\Users\\lukec\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2 
 
  ---------------------------------------- 
  Failed building wheel for lxml 
  Running setup.py clean for lxml 
Failed to build lxml 
Installing collected packages: lxml 
  Running setup.py install for lxml ... error 
    Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\lukec\\appdata\\local\\temp\\pip-build-1ul2r3\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\lukec\appdata\local\temp\pip-cdhadi-record\install-record.txt --single-version-externally-managed --compile: 
    Building lxml version 3.7.1. 
    Building without Cython. 
    ERROR: 'xslt-config' is not recognized as an internal or external command, 
    operable program or batch file. 
 
    ** make sure the development packages of libxml2 and libxslt are installed ** 
 
    Using build configuration of libxslt 
    running install 
    running build 
    running build_py 
    creating build 
    creating build\lib.win32-2.7 
    creating build\lib.win32-2.7\lxml 
    copying src\lxml\builder.py -> build\lib.win32-2.7\lxml 
    copying src\lxml\cssselect.py -> build\lib.win32-2.7\lxml 
    copying src\lxml\doctestcompare.py -> build\lib.win32-2.7\lxml 
    copying src\lxml\ElementInclude.py -> build\lib.win32-2.7\lxml 
    copying src\lxml\pyclasslookup.py -> build\lib.win32-2.7\lxml 
    copying src\lxml\sax.py -> build\lib.win32-2.7\lxml 
    copying src\lxml\usedoctest.py -> build\lib.win32-2.7\lxml 
    copying src\lxml\_elementpath.py -> build\lib.win32-2.7\lxml 
    copying src\lxml\__init__.py -> build\lib.win32-2.7\lxml 
    creating build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\__init__.py -> build\lib.win32-2.7\lxml\includes 
    creating build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\builder.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\clean.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\defs.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\diff.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\ElementSoup.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\formfill.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\html5parser.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\soupparser.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\usedoctest.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\_diffcommand.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\_html5builder.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\_setmixin.py -> build\lib.win32-2.7\lxml\html 
    copying src\lxml\html\__init__.py -> build\lib.win32-2.7\lxml\html 
    creating build\lib.win32-2.7\lxml\isoschematron 
    copying src\lxml\isoschematron\__init__.py -> build\lib.win32-2.7\lxml\isoschematron 
    copying src\lxml\lxml.etree.h -> build\lib.win32-2.7\lxml 
    copying src\lxml\lxml.etree_api.h -> build\lib.win32-2.7\lxml 
    copying src\lxml\includes\c14n.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\config.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\relaxng.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\schematron.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\tree.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\uri.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\xinclude.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\xpath.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\xslt.pxd -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\etree_defs.h -> build\lib.win32-2.7\lxml\includes 
    copying src\lxml\includes\lxml-version.h -> build\lib.win32-2.7\lxml\includes 
    creating build\lib.win32-2.7\lxml\isoschematron\resources 
    creating build\lib.win32-2.7\lxml\isoschematron\resources\rng 
    copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win32-2.7\lxml\isoschematron\resources\rng 
    creating build\lib.win32-2.7\lxml\isoschematron\resources\xsl 
    copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl 
    copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl 
    creating build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
    running build_ext 
    building 'lxml.etree' extension 
    creating build\temp.win32-2.7 
    creating build\temp.win32-2.7\Release 
    creating build\temp.win32-2.7\Release\src 
    creating build\temp.win32-2.7\Release\src\lxml 
    C:\Users\lukec\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc\lxml\includes -Ic:\python27\include -Ic:\python27\PC /Tcsrc\lxml\lxml.etree.c /Fobuild\temp.win32-2.7\Release\src\lxml\lxml.etree.obj -w 
    cl : Command line warning D9025 : overriding '/W3' with '/w' 
    lxml.etree.c 
    src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory 
    Compile failed: command 'C:\\Users\\lukec\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2 
    C:\Users\lukec\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/include/libxml2 /Tcc:\users\lukec\appdata\local\temp\xmlXPathInitnuupun.c /Fousers\lukec\appdata\local\temp\xmlXPathInitnuupun.obj 
    xmlXPathInitnuupun.c 
    c:\users\lukec\appdata\local\temp\xmlXPathInitnuupun.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory 
    ********************************************************************************* 
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? 
    ********************************************************************************* 
    error: command 'C:\\Users\\lukec\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2 
 
    ---------------------------------------- 
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\lukec\\appdata\\local\\temp\\pip-build-1ul2r3\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\lukec\appdata\local\temp\pip-cdhadi-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\lukec\appdata\local\temp\pip-build-1ul2r3\lxml\ 

最后,它说我收到错误代码一,就在这之前,它说“无法在库 libxml2 中找到函数 xmlCheckVersion。是否安装了 libxml2?”

********************************************************************************* 
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? 
********************************************************************************* 
    error: command 'C:\\Users\\lukec\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2 
 
    ---------------------------------------- 
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\lukec\\appdata\\local\\temp\\pip-build-1ul2r3\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\lukec\appdata\local\temp\pip-cdhadi-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\lukec\appdata\local\temp\pip-build-1ul2r3\lxml\ 

我尝试查看如何在 Windows 10 上安装 libxml2,但没有成功。当我从 here 下载最新版本时,我在使用 python 安装模块时遇到了问题。 (我解压缩文件,进入它,并找到一个 setup.py,但得到以下错误:)

C:\Users\lukec\Downloads\libxml2-2.9.4\libxml2-2.9.4\python>python setup.py install 
failed to find headers for libxml2: update includes_dir 

有什么想法吗?我真的很感激任何帮助,我已经把这个项目做成了放学期间要做的事情,并希望在我回去之前完成所有功能!不久前我找到了另一个 slack 页面,但似乎再也找不到了,但它的说明对我来说有点模糊。 :(

再次感谢您,我希望您能就如何操作提出任何建议。

请您参考如下方法:

只是有同样的问题 - 我所做的是以下内容:

-- 从这里下载 libxml 和 lxml:http://www.lfd.uci.edu/~gohlke/pythonlibs/

-- 通过“pip install Filename.whl”安装

-- 运行 pip install fbchat

希望这对您有所帮助。

干杯