在Fedora上安装python软件包时出错 [英] Error installing python packages on Fedora

查看:100
本文介绍了在Fedora上安装python软件包时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在探索网站漏洞测试的选项. Wapiti在我的本地VM上运行良好,因此我想在活动服务器上进行设置以减少运行时间.但这是我第一次尝试在此服务器上安装python软件包,但遇到了一些麻烦.

I'm exploring options for vulnerability testing of my sites. Wapiti runs nicely on my local VM, so I want to set it up on a live server to decrease runtime. But this is my first time trying to install a python package on this server and I'm having some trouble.

我怀疑存在python配置错误或类似错误,因为我在不尝试安装软件包时看到错误事件.这是怎么回事?

我具有root用户访问权限,因此(根据此信息:正确python安装目录的权限?)我这样做了:

I have root access so (per this post: Proper permissions for python installation directory?) I did this:

[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应该起作用)会给出完全相同的错误.

Running pip with a help flag (I'm assume -h should work) gives the exact same error.

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

Update: Running python in interactive mode gives the following error:

[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 python setup.py install (which worked fine on my debian VM) gives me a bunch of output that I'm unfamiliar with, including several syntax errors:

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

推荐答案

我想到了两个想法……首先,pip-1.5是否有可能使用了与您安装的python版本不兼容的语法(是2.4)?有问题的代码正在执行python的三元操作.如果您以交互方式执行此操作,会发生什么情况?

Two thoughts occur to me...first, is it possible that pip-1.5 uses syntax that is not compatible with your installed version of python (which appears to be 2.4)? The code in question is executing the ternary operation of python. If you do this in interactive mode what happens?

# python
>>> True if True else False

(应该显示"True")

(it should print 'True')

第二个是您是否真的迷失了一个pip错误.

The second, is whether or not you've actually stumbled on a pip bug.

我刚刚检查了源代码 https://github.com/pypa /pip/blob/develop/pip/log.py 和第19行(在引用中引用)并不完全匹配(这很接近,但是各行的格式略有不同).您可能捕获了一些期中发行版.您可以尝试:

I just checked the source https://github.com/pypa/pip/blob/develop/pip/log.py, and line 19 (quoted in your traceback) doesn't precisely match (it's close, but the lines are formatted slightly differently). It's possible you caught some sort of interm release. You could try:

# easy_install upgrade pip

这可能会解决它.

如果没有,您可能会降级为1.3点(我通常最常使用的点).

If not, you might downgrade to pip 1.3 (which I typically use most often).

# easy_install "pip==1.3.1"

这篇关于在Fedora上安装python软件包时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆