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?
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
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 :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With