每當我嘗試使用PIP我找不到任何類似這個問題。問題恰恰2個參數(3給出)
我得到這個異常(使用Scrapy爲例):
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)
我使用Windows 7 32位,Python 2.7版
該異常與引用的源代碼行不匹配。完全一樣。你有沒有在編輯'pip'源文件? –
我現在要做的是:從'c:\ python27 \ lib \ site-packages \'中刪除整個'pip'目錄並重新安裝。很可能,'.pyc'字節緩存文件是陳舊的,不再與'index.py'(可能還有其他文件)的源相匹配。 'parsed'對象只是一個'html5lib'分析樹,其中''html5lib'庫包含*'pip'庫源代碼樹。 –
我重新安裝它,我得到了同樣的結果。我沒有編輯點子源 – user3203242