0

I'm following a tutorial for BeautifulSoup and I need to use the lxml package

But when i try to install lxml using pip it always produces an error at the end and therefore lxml will not be installed.

This is what I did:

pip install lxml

But this is what I got:

PS C:\Users\foo> pip install lxml
Downloading/unpacking lxml
  Real name of requirement lxml is lxml
  Downloading lxml-3.2.4.tar.gz (3.3Mb): 3.1Mb downloaded
Exception:
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip\basecommand.py", line 126, in main
    self.run(options, args)
  File "C:\Python27\lib\site-packages\pip\commands\install.py", line 223, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle,     bundle=self.b
  File "C:\Python27\lib\site-packages\pip\req.py", line 961, in prepare_files
    self.unpack_url(url, location, self.is_download)
  File "C:\Python27\lib\site-packages\pip\req.py", line 1079, in unpack_url
    return unpack_http_url(link, location, self.download_cache, only_download)
  File "C:\Python27\lib\site-packages\pip\download.py", line 449, in unpack_http_url
    download_hash = _download_url(resp, link, temp_location)
  File "C:\Python27\lib\site-packages\pip\download.py", line 367, in _download_url
    chunk = resp.read(4096)
  File "C:\Python27\lib\socket.py", line 380, in read
    data = self._sock.recv(left)
  File "C:\Python27\lib\httplib.py", line 561, in read
    s = self.fp.read(amt)
  File "C:\Python27\lib\socket.py", line 380, in read
    data = self._sock.recv(left)
  File "C:\Python27\lib\ssl.py", line 232, in recv
    return self.read(buflen)
  File "C:\Python27\lib\ssl.py", line 151, in read
    return self._sslobj.read(len)
SSLError: The read operation timed out

I am newbie but has never had problem with installing any package.

Please am I missing anything? Thanks in advance

  • lxml requires libxml2, which is no picnic to compile, alone, on Windows. I would simply grab Python(xy), which comes with lxml (and a hell of a lot of other awesome and correct stuff), and keep going. But your actual question deserves an answer. Did pip write a build folder with a log file you can read? – Phlip Nov 10 '13 at 16:21
  • `lxml` is a C-based extension. Probably following this [answer](http://stackoverflow.com/a/19884061/1265154) will save you time and efforts. – alko Nov 10 '13 at 16:23
  • as for original question, please refer to http://stackoverflow.com/questions/9847470/pip-search-django-produces-time-out-error – alko Nov 10 '13 at 16:25
  • try [an unofficial binary installer for lxml](http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml) – jfs Nov 10 '13 at 17:34
  • i used the unofficial binary installer referenced by @J.F.Sebastian ..not because the other comments wasn't helpful but because I **like** installers :) – fromPythonImportNoob Nov 10 '13 at 21:38

0 Answers0