Ask Your Question
1

askbot-setup SyntaxError: invalid syntax

asked 2011-09-06 10:28:44 -0500

Mauricio's avatar

updated 2011-09-11 19:57:36 -0500

Evgeny's avatar

Hello, Im installing askbot. I'm a newby to python so sorry if question is too dumb.

I opted to install it with:

git clone git://github.com/ASKBOT/askbot-devel.git milexpertos

Aftwerwards:

python setup.py develop

Then:

askbot-setup

and I got the following error:

Traceback (most recent call last): File "/usr/bin/askbot-setup", line 7, in ? sys.exit( File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 318, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 2221, in load_entry_point return ep.load() File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/var/www/milexpertos.org/milexpertos/askbot/deployment/__init__.py", line 6, in ? from askbot.deployment import messages File "/var/www/milexpertos.org/milexpertos/askbot/deployment/messages.py", line 4, in ? from askbot.deployment import path_utils File "/var/www/milexpertos.org/milexpertos/askbot/deployment/path_utils.py", line 113 with file(file_path, 'a'): ^ SyntaxError: invalid syntax

Could you please guide me with a starting point to fix it?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2011-09-06 11:51:29 -0500

Evgeny's avatar

keyword with will not work in python2.4

Can you install newer version of python, or maybe you already have it on your system?

edit flag offensive delete link more

Comments

1

I'm installing on shared hosting on python 2.5 and get the same error. Is 2.6 required? Or is it a compatibility bug?

Victor's avatar Victor  ( 2011-09-11 16:51:44 -0500 )edit

Victor, actually you are right, keyword "with" was introduced in python 2.6, so I will remove it from this use case, it is not so important. In python 2.5 it would work, but you'd have to call

from __future__ import with

to make it work.

Evgeny's avatar Evgeny  ( 2011-09-11 16:58:45 -0500 )edit

Removed use of the with statement, so askbot should now work in python2.5, really the only part that did not was askbot-setup script.

Evgeny's avatar Evgeny  ( 2011-09-11 19:58:50 -0500 )edit

Evgeny, thanks very much!

Mauricio's avatar Mauricio  ( 2011-09-14 15:15:32 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-09-06 10:28:44 -0500

Seen: 8,899 times

Last updated: Sep 06 '11