Tom
Tom

Reputation: 2847

How to run web2py in ubuntu?

I downloaded the source code package from http://web2py.com/examples/default/download , but I can't start web2py using this command:

tom@ubuntu:~/web2py$ python web2py.py -a 'your password' -i 127.0.0.1 -p 8000
Traceback (most recent call last):
  File "web2py.py", line 16, in <module>
    import gluon.widget
  File "/home/tom/web2py/gluon/widget.py", line 85
    print 'warning: unable to detect your browser'
                                                 ^
SyntaxError: invalid syntax

I am using python3.1,how can run web2py by this version?

Upvotes: 3

Views: 6155

Answers (4)

warvariuc
warvariuc

Reputation: 59594

If Python 3 is your default interpreter, instead of

python web2py.py -a 'your password' -i 127.0.0.1 -p 8000

use

python2.7 web2py.py -a 'your password' -i 127.0.0.1 -p 8000

Upvotes: 3

Mandar Vaze
Mandar Vaze

Reputation: 1429

From the download link provided above :

The source code version works on all supported platforms, including Linux, but it requires Python 2.4, 2.5, 2.6, or 2.7

Upvotes: 0

Arun Karunagath
Arun Karunagath

Reputation: 1578

python3 changed print statement to print function.

ie., in python3 print "bla bla bla" should be print("bla bla bla")

web2py isn't changed to python3 yet, reason being, not all 3rd party libraries distributed via web2py doesn't changed to python3 yet.

Upvotes: 0

Michał Niklas
Michał Niklas

Reputation: 54292

web2py officially runs with Python 2.5. On my machine it runs with 2.6.

As of Python 3 "porting", this was asked on web2py mailing list: http://groups.google.com/group/web2py/browse_thread/thread/5fcd0e97452e9ab8

You can install Python 2.5 (or other version) and for some programs including web2py use it, and for others use Python 3. I work this way :)

Upvotes: 2

Related Questions