gpt4 book ai didi

python - 无法在 Windows 上安装 python lxml(和 libxml2)

转载 作者:太空狗 更新时间:2023-10-29 21:45:48 25 4
gpt4 key购买 nike

我正在尝试在 Windows 上安装 lxml (pip install lxml) 但我一直收到以下错误:

*****
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
****************************************************************************

Command "C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Us
ers\\meme\\AppData\\Local\\Temp\\pip-build-m_doxfaj\\lxml\\setup.py';exec(comp
ile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __fi
le__, 'exec'))" install --record C:\Users\meme\AppData\Local\Temp\pip-ekkhc0id
-record\install-record.txt --single-version-externally-managed --compile" failed
with error code 1 in C:\Users\meme\AppData\Local\Temp\pip-build-m_doxfaj\lxml

我尝试从此处 ( ftp://ftp.zlatkovic.com/libxml/ ) 下载适用于 Windows 的二进制文件并将它们添加到路径,但它似乎没有帮助。

尝试安装时手动下载 lxml wheel(http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml for cp34)文件也失败,并显示以下错误日志:

Exception:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\basecommand.py", line 211, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 311, in run
root=options.root_path,
File "C:\Python34\lib\site-packages\pip\req\req_set.py", line 646, in install
**kwargs
File "C:\Python34\lib\site-packages\pip\req\req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "C:\Python34\lib\site-packages\pip\req\req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "C:\Python34\lib\site-packages\pip\wheel.py", line 242, in move_wheel_files
name, user=user, home=home, root=root, isolated=isolated
File "C:\Python34\lib\site-packages\pip\locations.py", line 182, in distutils_scheme
d.parse_config_files()
File "C:\Python34\lib\distutils\dist.py", line 394, in parse_config_files
parser.read(filename)
File "C:\Python34\lib\configparser.py", line 672, in read
self._read(fp, filename)
File "C:\Python34\lib\configparser.py", line 993, in _read
for lineno, line in enumerate(fp, start=1):
File "C:\Python34\lib\encodings\cp1250.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x88 in position 2193: character maps to <undefined>

我在 x64 win7 机器上使用 python34 32 位。

最佳答案

您可以尝试来自 here 的二进制文件.先做pip install wheel然后 pip install <filename.whl>安装下载的二进制文件。

关于python - 无法在 Windows 上安装 python lxml(和 libxml2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34232887/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com