Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run web2py in ubuntu?

Tags:

ubuntu

web2py

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?

like image 377
Tom Avatar asked Dec 07 '25 03:12

Tom


2 Answers

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
like image 112
warvariuc Avatar answered Dec 08 '25 19:12

warvariuc


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

like image 40
Michał Niklas Avatar answered Dec 08 '25 20:12

Michał Niklas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!