problems running PY4WEB

263 views
Skip to first unread message

Kevin Fonseca

unread,
Oct 11, 2019, 1:38:53 AM10/11/19
to web2py-users
i am having problems when i tried to run PY4WEB 
de error log is :
2019-10-10 13:23:10,259: Error running WSGI application
2019-10-10 13:23:10,277: FileNotFoundError: [Errno 2] No such file or directory: 'apps/__init__.py'
2019-10-10 13:23:10,277:   File "/var/www/kevin2811_pythonanywhere_com_wsgi.py", line 22, in <module>
2019-10-10 13:23:10,277:     from bottle_app import application
2019-10-10 13:23:10,278: 
2019-10-10 13:23:10,278:   File "/home/kevin2811/bottle_app.py", line 4, in <module>
2019-10-10 13:23:10,278:     application = wsgi(password_file=password_file, dashboard_mode='full')
2019-10-10 13:23:10,278: 
2019-10-10 13:23:10,278:   File "/home/kevin2811/.local/lib/python3.7/site-packages/py4web/core.py", line 771, in wsgi
2019-10-10 13:23:10,279:     Reloader.import_apps()
2019-10-10 13:23:10,279: 
2019-10-10 13:23:10,279:   File "/home/kevin2811/.local/lib/python3.7/site-packages/py4web/core.py", line 664, in import_apps
2019-10-10 13:23:10,279:     'apps', path).load_module()
2019-10-10 13:23:10,279: ***************************************************
2019-10-10 13:23:10,280: If you're seeing an import error and don't know why,
2019-10-10 13:23:10,281: we have a dedicated help page to help you debug: 
2019-10-10 13:23:10,281: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-10-10 13:23:10,281: ***************************************************
2019-10-10 13:23:13,431: Error running WSGI application
2019-10-10 13:23:13,433: FileNotFoundError: [Errno 2] No such file or directory: 'apps/__init__.py'
2019-10-10 13:23:13,434:   File "/var/www/kevin2811_pythonanywhere_com_wsgi.py", line 22, in <module>
2019-10-10 13:23:13,435:     from bottle_app import application
2019-10-10 13:23:13,435: 
2019-10-10 13:23:13,436:   File "/home/kevin2811/bottle_app.py", line 4, in <module>
2019-10-10 13:23:13,437:     application = wsgi(password_file=password_file, dashboard_mode='full')
2019-10-10 13:23:13,438: 
2019-10-10 13:23:13,438:   File "/home/kevin2811/.local/lib/python3.7/site-packages/py4web/core.py", line 771, in wsgi
2019-10-10 13:23:13,441:     Reloader.import_apps()
2019-10-10 13:23:13,441: 
2019-10-10 13:23:13,442:   File "/home/kevin2811/.local/lib/python3.7/site-packages/py4web/core.py", line 664, in import_apps
2019-10-10 13:23:13,442:     'apps', path).load_module()
2019-10-10 13:23:13,442: ***************************************************
2019-10-10 13:23:13,443: If you're seeing an import error and don't know why,
2019-10-10 13:23:13,443: we have a dedicated help page to help you debug: 
2019-10-10 13:23:13,443: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-10-10 13:23:13,444: ***************************************************
2019-10-10 13:23:13,895: Error running WSGI application
2019-10-10 13:23:13,896: FileNotFoundError: [Errno 2] No such file or directory: 'apps/__init__.py'
2019-10-10 13:23:13,896:   File "/var/www/kevin2811_pythonanywhere_com_wsgi.py", line 22, in <module>
2019-10-10 13:23:13,896:     from bottle_app import application
2019-10-10 13:23:13,897: 
2019-10-10 13:23:13,897:   File "/home/kevin2811/bottle_app.py", line 4, in <module>
2019-10-10 13:23:13,898:     application = wsgi(password_file=password_file, dashboard_mode='full')
2019-10-10 13:23:13,898: 
2019-10-10 13:23:13,898:   File "/home/kevin2811/.local/lib/python3.7/site-packages/py4web/core.py", line 771, in wsgi
2019-10-10 13:23:13,899:     Reloader.import_apps()
2019-10-10 13:23:13,899: 
2019-10-10 13:23:13,900:   File "/home/kevin2811/.local/lib/python3.7/site-packages/py4web/core.py", line 664, in import_apps
2019-10-10 13:23:13,900:     'apps', path).load_module()
2019-10-10 13:23:13,900: ***************************************************
2019-10-10 13:23:13,900: If you're seeing an import error and don't know why,
2019-10-10 13:23:13,900: we have a dedicated help page to help you debug: 
2019-10-10 13:23:13,901: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-10-10 13:23:13,901: ***************************************************

Massimo Di Pierro

unread,
Oct 11, 2019, 2:14:27 AM10/11/19
to web2py-users
It is not finding the apps folder. You can pass the full path to wsgi(apps_folder='/full/path/to/apps')

lu ond

unread,
Oct 18, 2019, 8:10:15 PM10/18/19
to web2py-users
Dear Massimo,
I tried to install py4web in windows 10, but a got an NotImplementedError when entered py4web-start apps and the page was not available. The full stack trace was as follows. Did I made some mistake?


Microsoft Windows [versão 10.0.18362.418]
(c) 2019 Microsoft Corporation. Todos os direitos reservados.
C:\Users\Gatinha>py4web-start apps
██████╗ ██╗   ██╗██╗  ██╗██╗    ██╗███████╗██████╗
██╔══██╗╚██╗ ██╔╝██║  ██║██║    ██║██╔════╝██╔══██╗
██████╔╝ ╚████╔╝ ███████║██║ █╗ ██║█████╗  ██████╔╝
██╔═══╝   ╚██╔╝  ╚════██║██║███╗██║██╔══╝  ██╔══██╗
██║        ██║        ██║╚███╔███╔╝███████╗██████╔╝
╚═╝        ╚═╝        ╚═╝ ╚══╝╚══╝ ╚══════╝╚═════╝
Is still experimental...
Choose a one-time dashboard password:
Storing the hashed password in file "password.txt"
[ ] Unzipping app py4web.app._dashboard.zip
[A[X]
[ ] Unzipping app py4web.app._default.zip
[A[X]
Dashboard is at: http://127.0.0.1:8000/_dashboard
[ ] loading _dashboard ...
[A[X] loaded _dashboard
[ ] loading _default ...
[A[X] loaded _default
Bottle v0.12.17 server starting up (using TornadoServer())...
Listening on http://127.0.0.1:8000/
Hit Ctrl-C to quit.
Traceback (most recent call last):
  File "C:\Users\Gatinha\AppData\Local\Programs\Python\Python38-32\Scripts\py4web-start-script.py", line 11, in <module>
    load_entry_point('py4web==0.1.20190929.1', 'console_scripts', 'py4web-start')()
  File "C:\Users\Gatinha\AppData\Local\Programs\Python\Python38-32\lib\site-packages\py4web\core.py", line 852, in main
    start_server(args)
  File "C:\Users\Gatinha\AppData\Local\Programs\Python\Python38-32\lib\site-packages\py4web\core.py", line 750, in start_server
    bottle.run(server='tornado', host=host, port=int(port), reloader=False)
  File "C:\Users\Gatinha\AppData\Local\Programs\Python\Python38-32\Scripts\bottle.py", line 3131, in run
    server.run(app)
  File "C:\Users\Gatinha\AppData\Local\Programs\Python\Python38-32\Scripts\bottle.py", line 2862, in run
    server.listen(port=self.port,address=self.host)
  File "C:\Users\Gatinha\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tornado\tcpserver.py", line 152, in listen
    self.add_sockets(sockets)
  File "C:\Users\Gatinha\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets
    self._handlers[sock.fileno()] = add_accept_handler(
  File "C:\Users\Gatinha\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tornado\netutil.py", line 279, in add_accept_handler
    io_loop.add_handler(sock, accept_handler, IOLoop.READ)
  File "C:\Users\Gatinha\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tornado\platform\asyncio.py", line 99, in add_handler
    self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
  File "C:\Users\Gatinha\AppData\Local\Programs\Python\Python38-32\lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

Massimo Di Pierro

unread,
Oct 21, 2019, 2:10:16 AM10/21/19
to web2py-users
This is the problem:

Try the latest master. Includes a fix. It will never be as good on Windows as on Linux/Mac.

Dave S

unread,
Dec 18, 2019, 1:34:23 AM12/18/19
to web2py-users


On Thursday, October 10, 2019 at 10:38:53 PM UTC-7, Kevin Fonseca wrote:


oops, another pinned post!  Please save pinning for messages that need long-term visibility.

/dps
 

Massimo Di Pierro

unread,
Dec 25, 2019, 1:51:10 PM12/25/19
to web2py-users
not sure why this is pinned and how to unpin. :-(
Reply all
Reply to author
Forward
0 new messages