在Fed上安装python包时出错

2024-10-01 10:16:17 发布

您现在位置:Python中文网/ 问答频道 /正文

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

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

我有根访问权限,所以(根据这篇文章: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会出现以下错误:

^{pr2}$

运行python setup.py install(在我的debian虚拟机上运行得很好)给了我一堆我不熟悉的输出,包括几个语法错误:

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

Tags: topybuildreportegglinuxlibbyte
1条回答
网友
1楼 · 发布于 2024-10-01 10:16:17

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

# python
>>> True if True else False

(应该打印“True”)

第二,你是否真的碰上了一个pip错误。在

我刚刚检查了源代码https://github.com/pypa/pip/blob/develop/pip/log.py,第19行(在回溯中引用)不完全匹配(虽然很接近,但行的格式略有不同)。有可能你抓到了某种中间释放物。你可以试试:

^{pr2}$

这也许能解决问题。在

否则,您可能会降级到pip1.3(我通常最常使用它)。在

# easy_install "pip==1.3.1"

相关问题 更多 >