Login

Please fill in your details to login.





problems installing lxml

This page is mainly about problems installing lxml
As part of one of the Python scripts I use for work, I need to install the js2xml library to enable me to parse the static JavaScript in a webpage.

Recently, I reimaged my Windows 10 PC so lost all the Python installation modifications I had made, including the installation of this library. I would normally run through the script modules that are required and use
pip install <module>
to install them. However, when installing
js2xml
, it failed on the installation of a dependency called
lxml
with an error relating to Visual C++ Build Tools. It appears that lxml is not available as a standard python installation package and so,
pip
uses
setuptools
to (try to) compile it from source.

Try as I might, I could not find the correct VC++ Build Tools to enable this to work so, after lots of searching online, happened upon this amazing page Python Extension Packages for Windows.

If you look down the page, you'll find a pre-compiled
whl
(wheels) file for
lxml
, in my case, I choose the latest version,
lxml-4.9.0-cp311-cp311-win_amd64.whl
.

I simply downloaded this file into the root of the c: drive and ran...

pip install c:\\lxml-4.9.0-cp311-cp311-win_amd64.whl


...and installation proceeded without a hitch.
Last modified: January 15th, 2023
The Computing Café works best in landscape mode.
Rotate your device.
Dismiss Warning