Why does web2py crash for me upon startup?

2019-07-03 01:44发布

I"m trying to get web2py running on an Ubuntu machine. All the docs seem to indicate that to run it on a *nix system, you download the source and do:

python web2py.py

I grabbed the source (stable source, not the trunk, version 1.99.4) and tried the above, but after entering a password for the server I get (in the terminal):

$ python web2py.py 
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011
Version 1.99.4 (2011-12-14 14:46:14) stable
Database drivers available: google
Starting hardcron...
WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking
please visit:
    http://127.0.0.1:8000
starting browser...
failed to create drawable
DEBUG: connect attempt 0, connection error:
Traceback (most recent call last):
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
    self._adapter = ADAPTERS[self._dbname](*args)
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
    raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking
DEBUG: connect attempt 1, connection error:
Traceback (most recent call last):
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
    self._adapter = ADAPTERS[self._dbname](*args)
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
    raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
DEBUG: connect attempt 2, connection error:
Traceback (most recent call last):
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
    self._adapter = ADAPTERS[self._dbname](*args)
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
    raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
DEBUG: connect attempt 3, connection error:
Traceback (most recent call last):
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
    self._adapter = ADAPTERS[self._dbname](*args)
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
    raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
DEBUG: connect attempt 4, connection error:
Traceback (most recent call last):
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
    self._adapter = ADAPTERS[self._dbname](*args)
  File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
    raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver

And then in the browser I get:

Internal error
Ticket issued: welcome/127.0.0.1.2012-.....[abbreviated]

Any suggestions? I'm running Python 2.7.1+. I've read elsewhere that you also need pyschopg2 installed for web2py to run, and I've confirmed that this is in fact installed as well (I did a sudo apt-get install python-psycopg2 and got "python-psycopg2 is already the newest version").

标签: python web2py
2条回答
虎瘦雄心在
2楼-- · 2019-07-03 01:47

I just downloaded and web2py runs ok in ubuntu, python 2.7.2+

bruce@vaiubuntu:~/Downloads/web2py$ python web2py.py

web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011
Version 1.99.4 (2011-12-14 14:46:14) stable
Database drivers available: SQLite3, pymysql, PostgreSQL
Starting hardcron...

Are you trying to run web2py on appengine environment?

Do you have SQLITE module working ok in your Python?

A possibility is permission issue, your user have permission to write to web2py/* folder?

查看更多
劳资没心,怎么记你
3楼-- · 2019-07-03 02:12

It looks like a bug in web2py 1.99.4. I was having the same problem using Postgres and psycopg2, but in Windows.

I tried with 1.99.2 and it worked fine.

Actually, the bug seems to be related to the cryptic error message - 1.99.2 gave me the error message that the database doesn't exist, which was easily fixed. 1.99.4 does not mention the missing database. However, when I created the database and tried with 1.99.4, it worked fine.

查看更多
登录 后发表回答