在Fedora上安装python包时出错

时间:2014-02-18 16:05:56

标签: python installation syntax-error fedora

我正在探索我的网站漏洞测试的选项。 Wapiti在我的本地VM上运行得很好,所以我想在实时服务器上设置它以减少运行时间。但这是我第一次尝试在这台服务器上安装python包而我遇到了一些麻烦。

我怀疑有一个python配置错误或类似的东西,因为当我不尝试安装软件包时,我看到错误事件。这是怎么回事?

我有root访问权限(根据这篇帖子:Proper permissions for python installation directory?)我这样做了:

[root@site wapiti]# easy_install pip
[root@site wapiti]# pip install .
Traceback (most recent call last):
  File "/usr/bin/pip", line 7, in ?
    sys.exit(
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 236, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 2097, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 1830, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.4/site-packages/pip-1.5.2-py2.4.egg/pip/__init__.py", line 9, in ?
    from pip.log import logger
  File "/usr/lib/python2.4/site-packages/pip-1.5.2-py2.4.egg/pip/log.py", line 19
    real_consumer = (consumer if not isinstance(consumer, colorama.AnsiToWin32)
                               ^
SyntaxError: invalid syntax

使用帮助标志运行pip(我假设-h应该有效)会给出完全相同的错误。

更新:以交互模式运行python会出现以下错误:

[root@site wapiti]# python
Python 2.4.3 (#1, Jan  9 2013, 06:47:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> True if True else False
  File "<stdin>", line 1
    True if True else False
          ^
SyntaxError: invalid syntax

运行python setup.py install(在我的debian VM上工作正常)给了我一堆我不熟悉的输出,包括几个语法错误:

running install
running bdist_egg
running egg_info
writing requirements to wapiti.egg-info/requires.txt
writing wapiti.egg-info/PKG-INFO
writing top-level names to wapiti.egg-info/top_level.txt
writing dependency_links to wapiti.egg-info/dependency_links.txt
reading manifest file 'wapiti.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'wapiti.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/wapitiCore
copying build/lib/wapitiCore/__init__.py -> build/bdist.linux-x86_64/egg/wapitiCore
creating build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/mod_file.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/attack.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/__init__.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/mod_sql.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/mod_htaccess.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/mod_backup.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/mod_blindsql.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/mod_nikto.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/mod_crlf.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/mod_exec.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/mod_xss.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
copying build/lib/wapitiCore/attack/mod_permanentxss.py -> build/bdist.linux-x86_64/egg/wapitiCore/attack
creating build/bdist.linux-x86_64/egg/wapitiCore/report
copying build/lib/wapitiCore/report/jsonreportgenerator.py -> build/bdist.linux-x86_64/egg/wapitiCore/report
copying build/lib/wapitiCore/report/__init__.py -> build/bdist.linux-x86_64/egg/wapitiCore/report
copying build/lib/wapitiCore/report/txtreportgenerator.py -> build/bdist.linux-x86_64/egg/wapitiCore/report
copying build/lib/wapitiCore/report/vulneranetxmlreportgenerator.py -> build/bdist.linux-x86_64/egg/wapitiCore/report
copying build/lib/wapitiCore/report/openvasreportgenerator.py -> build/bdist.linux-x86_64/egg/wapitiCore/report
copying build/lib/wapitiCore/report/htmlreportgenerator.py -> build/bdist.linux-x86_64/egg/wapitiCore/report
copying build/lib/wapitiCore/report/reportgeneratorinfo.py -> build/bdist.linux-x86_64/egg/wapitiCore/report
copying build/lib/wapitiCore/report/reportgenerator.py -> build/bdist.linux-x86_64/egg/wapitiCore/report
copying build/lib/wapitiCore/report/xmlreportgenerator.py -> build/bdist.linux-x86_64/egg/wapitiCore/report
creating build/bdist.linux-x86_64/egg/wapitiCore/file
copying build/lib/wapitiCore/file/auxtext.py -> build/bdist.linux-x86_64/egg/wapitiCore/file
copying build/lib/wapitiCore/file/__init__.py -> build/bdist.linux-x86_64/egg/wapitiCore/file
copying build/lib/wapitiCore/file/vulnerabilityxmlparser.py -> build/bdist.linux-x86_64/egg/wapitiCore/file
copying build/lib/wapitiCore/file/anomalyxmlparser.py -> build/bdist.linux-x86_64/egg/wapitiCore/file
copying build/lib/wapitiCore/file/reportgeneratorsxmlparser.py -> build/bdist.linux-x86_64/egg/wapitiCore/file
creating build/bdist.linux-x86_64/egg/wapitiCore/net
copying build/lib/wapitiCore/net/swf_parser.py -> build/bdist.linux-x86_64/egg/wapitiCore/net
copying build/lib/wapitiCore/net/lswww.py -> build/bdist.linux-x86_64/egg/wapitiCore/net
copying build/lib/wapitiCore/net/__init__.py -> build/bdist.linux-x86_64/egg/wapitiCore/net
copying build/lib/wapitiCore/net/crawlerpersister.py -> build/bdist.linux-x86_64/egg/wapitiCore/net
copying build/lib/wapitiCore/net/jsoncookie.py -> build/bdist.linux-x86_64/egg/wapitiCore/net
copying build/lib/wapitiCore/net/lamejs.py -> build/bdist.linux-x86_64/egg/wapitiCore/net
copying build/lib/wapitiCore/net/HTTP.py -> build/bdist.linux-x86_64/egg/wapitiCore/net
creating build/bdist.linux-x86_64/egg/wapitiCore/net/jsparser
copying build/lib/wapitiCore/net/jsparser/jsparser.py -> build/bdist.linux-x86_64/egg/wapitiCore/net/jsparser
copying build/lib/wapitiCore/net/jsparser/__init__.py -> build/bdist.linux-x86_64/egg/wapitiCore/net/jsparser
creating build/bdist.linux-x86_64/egg/wapitiCore/language
copying build/lib/wapitiCore/language/vulnerability.py -> build/bdist.linux-x86_64/egg/wapitiCore/language
copying build/lib/wapitiCore/language/__init__.py -> build/bdist.linux-x86_64/egg/wapitiCore/language
copying build/lib/wapitiCore/language/language.py -> build/bdist.linux-x86_64/egg/wapitiCore/language
creating build/bdist.linux-x86_64/egg/wapitiCore/config
creating build/bdist.linux-x86_64/egg/wapitiCore/config/attacks
copying build/lib/wapitiCore/config/attacks/backupPayloads.txt -> build/bdist.linux-x86_64/egg/wapitiCore/config/attacks
copying build/lib/wapitiCore/config/attacks/blindSQLPayloads.txt -> build/bdist.linux-x86_64/egg/wapitiCore/config/attacks
copying build/lib/wapitiCore/config/attacks/execPayloads.txt -> build/bdist.linux-x86_64/egg/wapitiCore/config/attacks
copying build/lib/wapitiCore/config/attacks/fileHandlingPayloads.txt -> build/bdist.linux-x86_64/egg/wapitiCore/config/attacks
copying build/lib/wapitiCore/config/attacks/xssPayloads.txt -> build/bdist.linux-x86_64/egg/wapitiCore/config/attacks
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language/de
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language/de/LC_MESSAGES
copying build/lib/wapitiCore/config/language/de/LC_MESSAGES/wapiti.mo -> build/bdist.linux-x86_64/egg/wapitiCore/config/language/de/LC_MESSAGES
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language/en
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language/en/LC_MESSAGES
copying build/lib/wapitiCore/config/language/en/LC_MESSAGES/wapiti.mo -> build/bdist.linux-x86_64/egg/wapitiCore/config/language/en/LC_MESSAGES
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language/es
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language/es/LC_MESSAGES
copying build/lib/wapitiCore/config/language/es/LC_MESSAGES/wapiti.mo -> build/bdist.linux-x86_64/egg/wapitiCore/config/language/es/LC_MESSAGES
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language/fr
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language/fr/LC_MESSAGES
copying build/lib/wapitiCore/config/language/fr/LC_MESSAGES/wapiti.mo -> build/bdist.linux-x86_64/egg/wapitiCore/config/language/fr/LC_MESSAGES
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language/ms
creating build/bdist.linux-x86_64/egg/wapitiCore/config/language/ms/LC_MESSAGES
copying build/lib/wapitiCore/config/language/ms/LC_MESSAGES/wapiti.mo -> build/bdist.linux-x86_64/egg/wapitiCore/config/language/ms/LC_MESSAGES
creating build/bdist.linux-x86_64/egg/wapitiCore/config/reports
copying build/lib/wapitiCore/config/reports/generators.xml -> build/bdist.linux-x86_64/egg/wapitiCore/config/reports
creating build/bdist.linux-x86_64/egg/wapitiCore/config/vulnerabilities
copying build/lib/wapitiCore/config/vulnerabilities/anomalies.xml -> build/bdist.linux-x86_64/egg/wapitiCore/config/vulnerabilities
copying build/lib/wapitiCore/config/vulnerabilities/vulnerabilities.xml -> build/bdist.linux-x86_64/egg/wapitiCore/config/vulnerabilities
creating build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/de.po -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/en.po -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/es.po -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/file_list.txt -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/fr.po -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/generateSources.sh -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/generateTranslations.sh -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/ms.po -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
creating build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/de.po -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/en.po -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/es.po -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/file_list.txt -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/fr.po -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/generateSources.sh -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/generateTranslations.sh -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
copying build/lib/wapitiCore/language_sources/ms.po -> build/bdist.linux-x86_64/egg/wapitiCore/language_sources
creating build/bdist.linux-x86_64/egg/wapitiCore/report_template
copying build/lib/wapitiCore/report_template/index.html -> build/bdist.linux-x86_64/egg/wapitiCore/report_template
copying build/lib/wapitiCore/report_template/logo_clear.png -> build/bdist.linux-x86_64/egg/wapitiCore/report_template
creating build/bdist.linux-x86_64/egg/wapitiCore/report_template/css
copying build/lib/wapitiCore/report_template/css/kube.css -> build/bdist.linux-x86_64/egg/wapitiCore/report_template/css
copying build/lib/wapitiCore/report_template/css/kube.min.css -> build/bdist.linux-x86_64/egg/wapitiCore/report_template/css
copying build/lib/wapitiCore/report_template/css/master.css -> build/bdist.linux-x86_64/egg/wapitiCore/report_template/css
creating build/bdist.linux-x86_64/egg/wapitiCore/report_template/js
copying build/lib/wapitiCore/report_template/js/jquery-1.9.1.min.js -> build/bdist.linux-x86_64/egg/wapitiCore/report_template/js
copying build/lib/wapitiCore/report_template/js/kube.buttons.js -> build/bdist.linux-x86_64/egg/wapitiCore/report_template/js
copying build/lib/wapitiCore/report_template/js/kube.tabs.js -> build/bdist.linux-x86_64/egg/wapitiCore/report_template/js
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/mod_file.py to mod_file.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/attack.py to attack.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/mod_sql.py to mod_sql.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/mod_htaccess.py to mod_htaccess.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/mod_backup.py to mod_backup.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/mod_blindsql.py to mod_blindsql.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/mod_nikto.py to mod_nikto.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/mod_crlf.py to mod_crlf.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/mod_exec.py to mod_exec.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/mod_xss.py to mod_xss.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/attack/mod_permanentxss.py to mod_permanentxss.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/report/jsonreportgenerator.py to jsonreportgenerator.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/report/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/report/txtreportgenerator.py to txtreportgenerator.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/report/vulneranetxmlreportgenerator.py to vulneranetxmlreportgenerator.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/report/openvasreportgenerator.py to openvasreportgenerator.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/report/htmlreportgenerator.py to htmlreportgenerator.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/report/reportgeneratorinfo.py to reportgeneratorinfo.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/report/reportgenerator.py to reportgenerator.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/report/xmlreportgenerator.py to xmlreportgenerator.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/file/auxtext.py to auxtext.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/file/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/file/vulnerabilityxmlparser.py to vulnerabilityxmlparser.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/file/anomalyxmlparser.py to anomalyxmlparser.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/file/reportgeneratorsxmlparser.py to reportgeneratorsxmlparser.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/swf_parser.py to swf_parser.pyc
File "build/bdist.linux-x86_64/egg/wapitiCore/net/swf_parser.py", line 293
with open(sys.argv[1], 'rb') as fh:
            ^
SyntaxError: invalid syntax
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/lswww.py to lswww.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/crawlerpersister.py to crawlerpersister.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/jsoncookie.py to jsoncookie.pyc
  File "build/bdist.linux-x86_64/egg/wapitiCore/net/jsoncookie.py", line 45
    dotdomain = domain if domain[0] == '.' else '.' + domain
                        ^
SyntaxError: invalid syntax
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/lswww.py to lswww.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/crawlerpersister.py to crawlerpersister.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/jsoncookie.py to jsoncookie.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/lamejs.py to lamejs.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/HTTP.py to HTTP.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/jsparser/jsparser.py to jsparser.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/net/jsparser/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/language/vulnerability.py to vulnerability.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/language/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/wapitiCore/language/language.py to language.pyc
installing package data to build/bdist.linux-x86_64/egg
running install_data
creating build/bdist.linux-x86_64/egg/share
creating build/bdist.linux-x86_64/egg/share/doc
creating build/bdist.linux-x86_64/egg/share/doc/wapiti
copying doc/AUTHORS -> build/bdist.linux-x86_64/egg/share/doc/wapiti
copying doc/ChangeLog_Wapiti -> build/bdist.linux-x86_64/egg/share/doc/wapiti
copying doc/ChangeLog_lswww -> build/bdist.linux-x86_64/egg/share/doc/wapiti
copying doc/example.txt -> build/bdist.linux-x86_64/egg/share/doc/wapiti
copying INSTALL -> build/bdist.linux-x86_64/egg/share/doc/wapiti
copying README -> build/bdist.linux-x86_64/egg/share/doc/wapiti
copying TODO -> build/bdist.linux-x86_64/egg/share/doc/wapiti
copying VERSION -> build/bdist.linux-x86_64/egg/share/doc/wapiti
creating build/bdist.linux-x86_64/egg/share/man
creating build/bdist.linux-x86_64/egg/share/man/man1
copying doc/wapiti.1.gz -> build/bdist.linux-x86_64/egg/share/man/man1
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.4/wapiti -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.4/wapiti-cookie -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.4/wapiti-getcookie -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/wapiti to 755
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/wapiti-cookie to 755
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/wapiti-getcookie to 755
copying wapiti.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying wapiti.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying wapiti.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying wapiti.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying wapiti.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
wapitiCore.attack.attack: module references __file__
wapitiCore.report.htmlreportgenerator: module references __file__
wapitiCore.language.language: module references __file__
creating 'dist/wapiti-2.3.0-py2.4.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing wapiti-2.3.0-py2.4.egg
removing '/usr/lib/python2.4/site-packages/wapiti-2.3.0-py2.4.egg' (and everything under it)
creating /usr/lib/python2.4/site-packages/wapiti-2.3.0-py2.4.egg
Extracting wapiti-2.3.0-py2.4.egg to /usr/lib/python2.4/site-packages
  File "/usr/lib/python2.4/site-packages/wapiti-2.3.0-py2.4.egg/wapitiCore/net/swf_parser.py", line 293
    with open(sys.argv[1], 'rb') as fh:
            ^
SyntaxError: invalid syntax
  File "/usr/lib/python2.4/site-packages/wapiti-2.3.0-py2.4.egg/wapitiCore/net/jsoncookie.py", line 45
    dotdomain = domain if domain[0] == '.' else '.' + domain
                        ^
SyntaxError: invalid syntax
Extracting wapiti-2.3.0-py2.4.egg to /usr/lib/python2.4/site-packages
wapiti 2.3.0 is already the active version in easy-install.pth
Installing wapiti script to /usr/bin
Installing wapiti-cookie script to /usr/bin
Installing wapiti-getcookie script to /usr/bin

Installed /usr/lib/python2.4/site-packages/wapiti-2.3.0-py2.4.egg
Processing dependencies for wapiti==2.3.0
Searching for requests>=1.2.3
Reading http://cheeseshop.python.org/pypi/requests/
Reading http://python-requests.org
Reading http://cheeseshop.python.org/pypi/requests/2.2.1
Best match: requests 2.2.1
Downloading https://pypi.python.org/packages/source/r/requests/requests-2.2.1.tar.gz#md5=ac27081135f58d1a43e4fb38258d6f4e
Processing requests-2.2.1.tar.gz
Running requests-2.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-KEPWKT/requests-2.2.1/egg-dist-tmp-dMjDIE
Traceback (most recent call last):
  File "setup.py", line 60, in ?
    install_requires=[
  File "/usr/lib64/python2.4/distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/usr/lib64/python2.4/distutils/dist.py", line 946, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.4/distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.4/site-packages/setuptools/command/install.py", line 76, in run
    self.do_egg_install()
  File "/usr/lib/python2.4/site-packages/setuptools/command/install.py", line 100, in do_egg_install
    cmd.run()
  File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 211, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 427, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 473, in install_item
    self.process_distribution(spec, dist, deps)
  File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 518, in process_distribution
    distros = WorkingSet([]).resolve(
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 481, in resolve
    dist = best[req.key] = env.best_match(req, self, installer)
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 717, in best_match
    return self.obtain(req, installer) # try and download/install
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 729, in obtain
    return installer(requirement)
  File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 446, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 471, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 655, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 930, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 919, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python2.4/site-packages/setuptools/sandbox.py", line 26, in run_setup
    DirectorySandbox(setup_dir).run(
  File "/usr/lib/python2.4/site-packages/setuptools/sandbox.py", line 63, in run
    return func()
  File "/usr/lib/python2.4/site-packages/setuptools/sandbox.py", line 29, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 29
    with open('README.rst') as f:
            ^
SyntaxError: invalid syntax

1 个答案:

答案 0 :(得分:0)

我想到了两个想法...首先,pip-1.5是否可能使用与您安装的python版本(似乎是2.4)不兼容的语法?有问题的代码正在执行python的三元操作。如果你在交互模式下这样做会发生什么?

# python
>>> True if True else False

(它应该打印'True')

第二,是你是否真的偶然发现了一个pip bug。

我刚检查了源https://github.com/pypa/pip/blob/develop/pip/log.py,第19行(在你的追溯中引用)并不完全匹配(它接近,但行的格式略有不同)。你有可能发现某种中间版本。你可以尝试:

# easy_install upgrade pip

这可能会解决它。

如果没有,你可能会降级到pip 1.3(我通常最常用)。

# easy_install "pip==1.3.1"