5

Today I installed python 3.7 on my windows 10 machine, and most things seem to be working, but when I try to run pip install lxml the install fails. Rather than finding an appropriate precompiled wheel, it appears to be downloading the source package, running setup.py bdist_wheel which in turn calls out to visual studio to try to build a C/C++ extension and that fails with:

Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

I believe the real question is why it needs to do this recompile in the first place. If I setup a virtual environment with python 3.6.6 on the same machine, pip install lxml downloads and installs the precompiled wheel just fine.

PyPI seems to have wheels for the lxml on 3.7 on windows, but maybe the platform names aren't matching properly or something. python -V -V on my machine returns:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
simmdan
  • 466
  • 4
  • 9

1 Answers1

10

Of course, as soon as I post the question I discover the answer. I thougt PyPI had a precompiled build for python 3.7 on windows, but when I tried to manually download and install I discovered that I read the version number I was looking at incorrectly (it was for python 2.7). When I looked down the list to python 3.7, I discovered that they currently only have posted a precompiled build for linux.

This site, however, does have a precompiled version for python 3.7 on windows. When I downloaded that, it installed just fine.

simmdan
  • 466
  • 4
  • 9
  • You've solved the problem for me too so thank you! Do you know of any way to get updated when there is an official wheel on pypi? – Ofer Sadan Jul 17 '18 at 15:34
  • I was about to post a similar Q/A post on here. To be honest I think for users trying to write setup instructions the easier path (particularly on windows) may be to recommend installing python 3.6.6. for now. For those installing via chocolatey this can be done via `choco install python --version 3.6.6` – Vivek Gani Jul 23 '18 at 19:50
  • 2
    I was able to download the .whl file but was unfamiliar with installing .whl files. To install the downloaded package simply run: python -m pip install C:\PathToWHLFile\filename.whl. (https://stackoverflow.com/questions/27885397/how-do-i-install-a-python-package-with-a-whl-file) – Justin Kauffman Jul 31 '18 at 06:08