3

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?

tfv
  • 6,016
  • 4
  • 36
  • 67
Tom
  • 2,857
  • 9
  • 46
  • 59

4 Answers4

3

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
warvariuc
  • 57,116
  • 41
  • 173
  • 227
2

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 :)

Michał Niklas
  • 53,067
  • 18
  • 70
  • 114
0

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.

Arun Karunagath
  • 1,593
  • 10
  • 24
0

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

Mandar Vaze
  • 1,324
  • 13
  • 20