0

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.

I suspect there is a python configuration error or something similar because I'm seeing errors event when I don't attempt to install the package. What's going on here?

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

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

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

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
Community
  • 1
  • 1
doub1ejack
  • 10,627
  • 20
  • 66
  • 125
  • There's the problem. Python 2.4 does NOT support the ternary operator, and therefore pip is not compatible. Check the line of code in the traceback and you should see what I'm saying. I think your choices are to either upgrade python (try going to 2.7), OR downgrade the version of pip to one that does not use the offending code. (If it were me, I'd go for upgrading python) – user590028 Feb 18 '14 at 16:44

1 Answers1

0

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

(it should print 'True')

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

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

That might fix it.

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

# easy_install "pip==1.3.1"
user590028
  • 11,364
  • 3
  • 40
  • 57
  • Thanks, I get an error with that simple conditional statement (see my update in the OP). – doub1ejack Feb 18 '14 at 16:35
  • Not sure if you saw -- I added another comment right after you edited your question -- http://stackoverflow.com/questions/21859089/error-installing-python-packages-on-fedora/21859679?noredirect=1#comment33093125_21859089 – user590028 Feb 18 '14 at 21:05
  • Yeah, I think updating python is the answer here. I switched to another server that already has Python 2.6 and did not experience the same problems. If you modify your answer to recommend an upgrade, I'll select it. Thanks! – doub1ejack Feb 19 '14 at 14:45
  • I tried make altinstall (instead of make install): https://docs.python.org/2/using/unix.html#on-linux – AKS Mar 23 '15 at 22:04