如何在ubuntu中运行web2py?
我从 http://web2py.com/examples/default/download 下载了源码包,但是我无法使用这个命令启动web2py:
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
我使用的是python3.1,如何通过这个版本运行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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果 Python 3 是您的默认解释器,则不要
使用
If Python 3 is your default interpreter, instead of
use
web2py
正式运行于 Python 2.5。在我的机器上运行的是 2.6。从 Python 3“移植”开始,web2py 邮件列表上提出了这个问题: http:// /groups.google.com/group/web2py/browse_thread/thread/5fcd0e97452e9ab8
您可以安装 Python 2.5(或其他版本),某些程序(包括
web2py
)可以使用它,其他程序也可以使用它Python 3.我就是这样工作的:)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 :)python3将打印语句更改为打印函数。
即,在 python3 中 print "bla bla bla" 应该是 print("bla bla bla")
web2py 尚未更改为 python3,原因是,并非所有通过 web2py 分发的第三方库都未更改为 python3。
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.
从上面提供的下载链接:
From the download link provided above :