horace_vr
horace_vr

Reputation: 3166

Python 3.5 - how to install lxml in Windows 7 64 bits

I am trying to install lxml with Python (32 bits) 3.5.1, on Windows 7 64 bits. I tried pip install lxml, but I got the famous error for missing "vcvarsall.bat". If I try to Install visual studio 2015, it requires 6 GB of free space, which I do not have available at the moment, and I'd rather not install a package which I do not plan to use.

I tried downloaded the wheel as suggested here and here, but I still get the whl file "is not a supported wheel on this platform". Wheel and pip are upgraded to the latest versions. What am I missing...?

Upvotes: 2

Views: 2778

Answers (1)

Mark Colan
Mark Colan

Reputation: 491

I have been struggling with this today. I found, elsewhere on stackoverflow.com, this two-part and quick solution, which resulted in python no longer complaining when I tried to use lxml:

  1. go to this repository and download a version which matches your Python installation (the version number, and 32- vs 64-bit. I use Python 3.5.1 64-bit, installed on Windows 10, so on that page, I chose lxml-3.6.0-cp35-cp35m-win_amd64.whl. You say you use the 32-bit version, so use a version that matches that.

My download directory is d:\Downloads. Python must be in your PATH environment variable for the next step to work. Use a command like the following, changing "D:\Downloads" to the pathname to your download directory. Then, at a DOS prompt, type:

  1. python -m pip install "D:\Downloads\lxml-3.6.0-cp35-cp35m-win_amd64.whl" lxml-3.6.0-cp35-cp35m-win_amd64.whl

Upvotes: 1

Related Questions