2

could somebody walk me through installing the python configobj module? I downloaded it from here but it throws an error during installation

except Exception, e:
                ^
SyntaxError: invalid syntax

I have Python 3.3.2 installed and the problem is known about the different syntax between Python 2.7 and 3.x. The question is, does anybody know a fix for this problem?

Andrei Stalbe
  • 1,511
  • 6
  • 26
  • 44

1 Answers1

2

In python 2.x the syntax for exceptions was

except Exception, e

This was changed in py2.7 and above to the cleaner

except Exception as e

To install the correct version try using pip

pip install configobj

Edit, on second look configobj doesn't seem to support python 3.x You now have three choices;

  • Port it yourself
  • Use an earlier Python version
  • Find an alternative module or roll your own.

Edit Edit,

Turns out someone has already done started on the hard work but its unreleased.

https://bitbucket.org/zubin71/configobj-py3/wiki/Home

Jakob Bowyer
  • 33,878
  • 8
  • 76
  • 91
  • 1
    Thank you. I forgot I used this in one of my previous projects. However I used it from this repo https://bitbucket.org/pkumar/configobj-py3/src – Andrei Stalbe Jul 17 '13 at 12:13