“Unable to find vcvarsall.bat” error when trying to install lxml

I needed the lxml library on a machine for some python script that I coded earlier. I tried using easy_install by doing

easy_install lxml

but then I got the following error:

Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3.3
Downloading http://lxml.de/files/lxml-2.3.3.tgz
Processing lxml-2.3.3.tgz
Running lxml-2.3.3\setup.py -q bdist_egg --dist-dir c:\users\edin\appdata\local\
temp\easy_install-9sxhlm\lxml-2.3.3\egg-dist-tmp-pjbtkm
Building lxml version 2.3.3.
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
warning: no files found matching 'lxml.etree.c' under directory 'src\lxml'
warning: no files found matching 'lxml.objectify.c' under directory 'src\lxml'
warning: no files found matching 'lxml.etree.h' under directory 'src\lxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'src\lxml'
warning: no files found matching 'etree_defs.h' under directory 'src\lxml'
warning: no files found matching 'pubkey.asc' under directory 'doc'
warning: no files found matching 'tagpython*.png' under directory 'doc'
warning: no files found matching 'Makefile' under directory 'doc'
error: Setup script exited with error: Unable to find vcvarsall.bat

I tried installing libxml2 and libxslt, but it resulted in similar errors.

Searching for libxml2
Reading http://pypi.python.org/simple/libxml2/
Couldn’t find index page for ‘libxml2’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for libxml2
Best match: None
Traceback (most recent call last):
File “C:\Python27\Scripts\easy_install-script.py”, line 8, in
load_entry_point(‘setuptools==0.6c11’, ‘console_scripts’, ‘easy_install’)()
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 1712, in main
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 1700, in with_ei_usage
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 1716, in
File “C:\Python27\lib\distutils\core.py”, line 152, in setup
dist.run_commands()
File “C:\Python27\lib\distutils\dist.py”, line 953, in run_commands
self.run_command(cmd)
File “C:\Python27\lib\distutils\dist.py”, line 972, in run_command
cmd_obj.run()
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 211, in run
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 434, in easy_install
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\pac
kage_index.py”, line 475, in fetch_distribution
AttributeError: ‘NoneType’ object has no attribute ‘clone’

In one of my previous posts I pointed out how you can solve a similar problem with a missing vcvarsall.bat error, but unfortunately that approach did not solve my problem. Compiling the sources from the ground up was a too intensive job (which I might try to figure out in the future), so I chose the easy path.

The issue was solved by installing these packages from this site which lists a lot of (unoffical) Windows binaries for Python. Everything suddenly started to work as it should. 🙂

One thought on ““Unable to find vcvarsall.bat” error when trying to install lxml”

Leave a Reply

Your email address will not be published. Required fields are marked *