0

I've been at this for nearly 2 hours and I just can't seem to get my head around it. I am a novice Pythoner, it would appear. I am trying to intsall lxml, (needed to install scrapy). I have tried multiple methods (see my other current quesitons).

Currently I am trying the following. I downloaded the lxml win 32 file for python 2.7 from this website: https://pypi.python.org/pypi/lxml/3.4.4#downloads The LXML Binaries are also available here: "http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml"

I download the .whl file.

I then open up CMD, and CD to my download folder. Once in that folder I run the following command (as per the answer to this question here: How do I install a Python package with a .whl file?)

pip install lxml-3.4.4-cp27-none-win32.whl

This is the output:

C:\Users\Charles\Downloads\python>pip install lxml-3.4.4-cp27-none-win32.whl
Downloading/unpacking lxml-3.4.4-cp27-none-win32.whl
  Could not find any downloads that satisfy the requirement lxml-3.4.4-cp27-    none
-win32.whl
No distributions at all found for lxml-3.4.4-cp27-none-win32.whl
Storing complete log in C:\Users\Charles\AppData\Roaming\pip\pip.log

Can anyone help me figure out what this means/what is going on? How can I execute this file to install the lxml as needed? Many thanks!!

Edit: I am using Windows 64 bit, but from this question here: "easy_install lxml on Python 2.7 on Windows" the file I have selected appears to be the correct one.

Community
  • 1
  • 1
Chuck
  • 3,664
  • 7
  • 42
  • 76

2 Answers2

1

I am using Windows 64 bit and use Scrapy. It took a while for me to figure out the best way to set up my virtualenv because lxml would not simply pip install.

So I did somethine very similar to what you did but it looks at first glance we may just be using different sites. So try downloading this .whl from HERE. Specifically, for your specifications I believe, grab the one that reads

lxml-3.4.4-cp27-none-win_amd64.whl

and then just cd to the downloads folder and pip install lxml-3.4.4-cp27-none-win_amd64.whl

Community
  • 1
  • 1
Liam Hanninen
  • 1,525
  • 2
  • 19
  • 37
1

The first thing you should do is upgrade pip; the latest version is 8.0. Next, you need to install wheel support (this step may be redundant in later versions) and then finally install your wheel:

pip install --upgrade pip
pip install wheel

lxml needs a lot of source-level dependencies, which are difficult to install in Windows. This is why the project provides binary installers for Windows. You can download these from the pypi page for lxml. Make sure you choose the right version for your environment:

  • lxml-3.4.4.win32-py2.7.exe - for Python 2.7 running on Windows 32-bit
  • lxml-3.4.4.win32-py3.2.exe - for Python 3.2 running on Windows 32-bit
  • lxml-3.4.4.win-amd64-py2.7.exe - for Python 2.7, running on Windows 64-bit
Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284