Can't install python lxml (and libxml2) on windows
Can't install python lxml (and libxml2) on windows
I'm trying to install lxml on windows (pip install lxml) but i keep getting following error:
*****
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
****************************************************************************
Command "C:Python34python.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('rn', 'n'), __fi
le__, 'exec'))" install --record C:UsersmemeAppDataLocalTemppip-ekkhc0id
-recordinstall-record.txt --single-version-externally-managed --compile" failed
with error code 1 in C:UsersmemeAppDataLocalTemppip-build-m_doxfajlxml
I've tried to download a binary files for windows from here (ftp://ftp.zlatkovic.com/libxml/) and adding them to path but it doesn't seem to help.
Manual download lxml wheel(http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml for cp34) file also fails upon trying to install with the following error log:
Exception:
Traceback (most recent call last):
File "C:Python34libsite-packagespipbasecommand.py", line 211, in main
status = self.run(options, args)
File "C:Python34libsite-packagespipcommandsinstall.py", line 311, in run
root=options.root_path,
File "C:Python34libsite-packagespipreqreq_set.py", line 646, in install
**kwargs
File "C:Python34libsite-packagespipreqreq_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "C:Python34libsite-packagespipreqreq_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "C:Python34libsite-packagespipwheel.py", line 242, in move_wheel_files
name, user=user, home=home, root=root, isolated=isolated
File "C:Python34libsite-packagespiplocations.py", line 182, in distutils_scheme
d.parse_config_files()
File "C:Python34libdistutilsdist.py", line 394, in parse_config_files
parser.read(filename)
File "C:Python34libconfigparser.py", line 672, in read
self._read(fp, filename)
File "C:Python34libconfigparser.py", line 993, in _read
for lineno, line in enumerate(fp, start=1):
File "C:Python34libencodingscp1250.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>
I'm using python34 32bit on x64 win7 machine.
2 Answers
2
You can try the binary from here.
First do pip install wheel
and then pip install <filename.whl>
to install the downloaded binary.
pip install wheel
pip install <filename.whl>
I've added error log from wheel install to OP.
– eciu
Dec 11 '15 at 21:49
this solved issue on Python 3.7
– Prateek
Jul 10 at 13:28
This worked wonderfully. Just had to make sure that I copied the file for my version of python into the venv lib folder and then ran the command while in the venv under the lib dir like you said. Thanks alot!
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Possible duplicate of Getting "Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?" when installing lxml through pip
– Steven Vascellaro
Feb 13 at 15:38