Reputation: 85
For a while now i have been trying to figure out how to install lxml but have had no such luck. As a last ditch of hope. I've come here for some solutions or clarification. So far I've already tried nearly all the ways told before in other answer threads but have had no luck.
Firstly I've tried the following:
pip install lxml
pip3 install lxml
python -m pip install lxml
Which threw an error...
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
C:\Users\Me\AppData\Local\Temp\xmlXPathInit1owazwq3.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:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for lxml
I then went on and tried to install wheel...
python -m pip install wheel
C:\Users\Me>python -m pip install wheel
Requirement already satisfied (use --upgrade to upgrade): wheel in c:\python35\lib\site-packages
Which seems to have worked.
However when i tried to install lxml again...
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Me\\AppData\\Local\\Temp\\pip-build-klrlh4_w\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Me\AppData\Local\Temp\pip-k3saekal-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Me\AppData\Local\Temp\pip-build-klrlh4_w\lxml\
i then tried downloading the .whl files..
python -m pip install lxml-3.6.0-cp35-cp35m-win_amd64.whl
^Downloaded nearly all of these .whl files
only to come to the same conclusion each and every
lxml-3.6.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
Sadly none of these have been able to install lxml...
Is lxml able to run on python3.5.1?
Any help at all will be helpful :)
Upvotes: 0
Views: 464
Reputation: 85
Check what version you need to download with...
import sys
is_64bits = sys.maxsize > 2**32
print(is_64bits )
Then download the right version of lxml.. http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
All credit goes to @Manjabes - https://stackoverflow.com/users/396571/manjabes
Thanks for the help <3
Upvotes: 1