Problems using pip, (Exception [...] findall () takes exactly 2 arguments (3 data)

I could not find anything like this problem.

Whenever I try to use pip, I get this exception (using Scrapy as an example):

C:\Python27\Scripts\pip-script.py run on 01/16/14 16:26:32
Requirement already satisfied (use --upgrade to upgrade): Scrapy in c:\python27\lib\site-packages\scrapy-0.20.2-py2.7.egg
Requirement already satisfied (use --upgrade to upgrade): Twisted>=10.0.0 in c:\python27\lib\site-packages (from Scrapy)
Downloading/unpacking w3lib>=1.2 (from Scrapy)
  Getting page https://pypi.python.org/simple/w3lib/
  URLs to search for versions for w3lib>=1.2 (from Scrapy):
  * https://pypi.python.org/simple/w3lib/
  Analyzing links from page https://pypi.python.org/simple/w3lib/
Cleaning up...
  Removing temporary dir c:\users\tobias\appdata\local\temp\pip_build_Tobias...
Exception:
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "c:\python27\lib\site-packages\pip\commands\install.py", line 270, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "c:\python27\lib\site-packages\pip\req.py", line 1157, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "c:\python27\lib\site-packages\pip\index.py", line 264, in find_requirement
    page_versions.extend(self._package_versions(page.links, req.name.lower()))
  File "c:\python27\lib\site-packages\pip\index.py", line 440, in _package_versions
    for link in self._sort_links(links):
  File "c:\python27\lib\site-packages\pip\index.py", line 430, in _sort_links
    for link in links:
  File "c:\python27\lib\site-packages\pip\index.py", line 772, in links
    for anchor in self.parsed.findall(".//a"):
TypeError: findall() takes exactly 2 arguments (3 given)

I am using Windows 7 32bit, Python 2.7

+4
source share
1 answer

I think you have some wrong version of elementtree. B pip, self.parsedshould be the html5lib tree tree returned html5lib.parse, valid on the HTML page from the package. readme for html5lib says:

xml.etree. , html5lib ElementTree (.. Xml.etree.cElementTree Python 2.x).

, , , OP , ElementTree -. , - (, cElementTree), html5lib , .

elementtree ( , ). , / pip .

( )

import xml.etree import elementtree. , help(xml.etree) help(elementtree) . , . ( 2008 ) elementtree , - .

+1

All Articles