WebFaction
Community site: login faq

Trying to install flask-tarbell package using:

pip3.3 install --user tarbell==0.9b6

Installation fails and I get this message:

Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_bwareham/wsgiref

From the log, it appears to be a problem with setuptools:

      Running setup.py (path:/tmp/pip_build_bwareham/wsgiref/setup.py) egg_info for package wsgiref
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_bwareham/wsgiref/setup.py", line 5, in <module>
        import ez_setup
      File "./ez_setup/__init__.py", line 170
        print "Setuptools version",version,"or greater has been installed."
                                 ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_bwareham/wsgiref/setup.py", line 5, in <module>

    import ez_setup

  File "./ez_setup/__init__.py", line 170

    print "Setuptools version",version,"or greater has been installed."

                             ^

SyntaxError: invalid syntax

Other package components seemed to download just fine. Any advice on how to rectify?

asked 16 Sep '14, 16:35

bwareham
32259
accept rate: 100%


The problem is that the package you're trying to install has not been packaged for Python 3+.

This is evidenced by the format of the print statement that is throwing the error:

print "Setuptools version",version,"or greater has been installed."

In Python 3+, print is a function, so the correct format would be:

print("Setuptools version",version,"or greater has been installed.")
permanent link

answered 16 Sep '14, 16:42

seanf
12.2k41836
accept rate: 37%

Yep. Should've caught that. Switched to Python 2.7 and seems to have worked.

(16 Sep '14, 17:08) bwareham

Dang, what if you don't want to switch to Python 2.7? Is there a way in virtualenv to temporarily switch?

This 2 to 3 thing seems a consistent headache cropping up all over the place.

(04 Oct '14, 08:35) Bernd Wechner

What you're suggesting is reasonable, but I'm not sure that it's possible. In this particular case, the tarbell python package itself appears to be completely compatible with Python 3, but its packaging (setup.py) is not, so you cannot pip install the package.

As a result, the tarbell package is easy to install for Python 3; just download the tarbell-0.9b6.tar.gz file and extract it, placing the tarbell directory into your virtual environment's lib directory next to its other libraries.

It would be useful to have full pip support for this package, or to have a way to temporarily use Python 2.7 to run the packaging setup.py. That may not be universally applicable, though, especially for python packages containing compiled code.

(04 Oct '14, 09:37) ryans ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×102
×53
×4

question asked: 16 Sep '14, 16:35

question was seen: 13,222 times

last updated: 04 Oct '14, 09:52

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM