2014-02-18 87 views
0

我在探索我的網站的漏洞測試選項。 Wapiti在我的本地虛擬機上運行良好,所以我想將它設置在實時服務器上以減少運行時間。但這是我第一次嘗試在這臺服務器上安裝python軟件包,並且遇到了一些麻煩。在Fedora上安裝python軟件包時出錯

我懷疑有一個python配置錯誤或類似的東西,因爲我看到錯誤事件,當我不嘗試安裝包。這裏發生了什麼?

我有(按這個帖子:Proper permissions for python installation directory?)根訪問我這樣做:用一個幫助標誌

[[email protected] wapiti]# easy_install pip 
[[email protected] 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提供了以下錯誤:

​​

運行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 
+0

存在問題。 Python 2.4不支持三元運算符,因此pip不兼容。檢查回溯代碼中的代碼行,你應該看到我在說什麼。我認爲你的選擇是升級python(嘗試去2.7),或者將pip的版本降級到不使用違規代碼的版本。 (如果是我,我會去升級python) – user590028

回答

0

兩個想法發生給我...首先,是有可能,PIP-1.5採用的語法與您的Python安裝的版本(這似乎是兼容2.4)?有問題的代碼正在執行python的三元操作。如果你在交互模式下這樣做會發生什麼?

# python 
>>> True if True else False 

(它應打印「真」)

第二個,就是無論是否實際上已經無意中發現了一個點子錯誤。

我剛剛檢查了源https://github.com/pypa/pip/blob/develop/pip/log.py,並且第19行(在回溯引用中)沒有精確匹配(它接近,但行格式稍有不同)。你有可能抓到某種中間人釋放。你可以嘗試:

# easy_install upgrade pip 

這可能會解決它。

如果不是,您可能會降級到點1.3(我通常最常使用的)。

# easy_install "pip==1.3.1" 
+0

謝謝,我得到了一個簡單的條件語句錯誤(請參閱我在OP中的更新)。 – doub1ejack

+0

不知道你是否看到過 - 我在編輯你的問題後添加了另一條評論 - http://stackoverflow.com/questions/21859089/error-installing-python-packages-on-fedora/21859679?noredirect=1# comment33093125_21859089 – user590028

+0

是的,我認爲更新Python是這裏的答案。我切換到另一臺已經有Python 2.6的服務器,但沒有遇到同樣的問題。如果您修改答案以推薦升級,我會選擇它。謝謝! – doub1ejack