running app from command line with no server startup window

160 views
Skip to first unread message

Jacob Thoennes

unread,
Apr 22, 2016, 12:36:10 PM4/22/16
to web2py-users
I'm trying to package my app like it says in the book:


My start.bat is as follows (i had to change it slightly as I didn't want users to see the server startup window, also PAUSE so I can actually see the error message):

web2py\web2py.exe -S init/default/index
PAUSE

It gives me this error:

IOError: [Errno 2] No such file or directory: 'applications\\init\\compiled\\controllers_default_index.pyc'

I do in fact have a file named 'controllers.default.index.pyc' in that folder, but it appears to be looking for underscores instead of periods. Any help to get my webpage started from command line would be greatly appreciated

Niphlod

unread,
Apr 22, 2016, 2:28:21 PM4/22/16
to web2py-users
what version are you on? I think that problem got fixed not a long time ago.

Jacob Thoennes

unread,
Apr 22, 2016, 3:29:05 PM4/22/16
to web...@googlegroups.com
I was initially on 2.13, I just updated to 2.14.5 and still have the same problem. Also after the update when I run the packed app from web2py.exe it is messing up and showing the default dictionary view instead of the view I specified, which didn't happen before (all I did was drag the application folder to the new web2py).

edit: I should clarify, what I did was drag the application folder to a up-to-date web2py install and then I went through the deployment steps with yet another new install while packing the app in the up-to-date web2py

Niphlod

unread,
Apr 25, 2016, 3:02:05 PM4/25/16
to web2py-users
you should pack the app in the same version it'll be executed ... did you copy the source and then packed on 2.14.5 and then executed on 2.14.5 or you kept the packed version of 2.13.x ?

Jacob Thoennes

unread,
Apr 25, 2016, 3:26:55 PM4/25/16
to web2py-users
Yes, I packed it with the new version, same as the one I installed it in. 

Niphlod

unread,
Apr 26, 2016, 10:31:08 AM4/26/16
to web2py-users
can you attach a minimal app that reproduces the error ? I can't replicate it.

Jacob Thoennes

unread,
Apr 26, 2016, 10:50:39 AM4/26/16
to web2py-users
It actually happens for me if I try to pack the welcome app. No background on the packed page when its loaded from the main web interface, broken view. Same underscores vs periods error when I run start.bat. I compiled and packed the welcome app from 2.14.5, loaded it into another web2py as init, that's it. Same start.bat as above.

Niphlod

unread,
Apr 26, 2016, 11:00:13 AM4/26/16
to web2py-users
I'm trying windows binaries and it doesn't throw any errors. On linux - source version - too. No errors whatsoever.

Jacob Thoennes

unread,
Apr 26, 2016, 11:37:06 AM4/26/16
to web2py-users
https://drive.google.com/file/d/0B75ZsUWhWMA2N0hlalh1SVdlUzQ/view?usp=sharing

Here's a link to the files I'm using that show errors. Running the web2py.exe in myapp should show the broken view, running the start.bat in myapp should show the underscore vs period error. The other web2py folder is the one I packed the welcome app from (everything is a clean install of 2.14.5 from wep2py.com). 

When you tried to replicate, did your compiled files have periods or underscores? 

Niphlod

unread,
Apr 26, 2016, 11:51:24 AM4/26/16
to web2py-users
a "dir" from compiled/ shows



26/04/2016  16:58            22.911 controllers.appadmin.bg_graph_model.pyc
26/04/2016  16:58            22.711 controllers.appadmin.ccache.pyc
26/04/2016  16:58            22.636 controllers.appadmin.csv.pyc
26/04/2016  16:58            22.761 controllers.appadmin.download.pyc
26/04/2016  16:58            22.836 controllers.appadmin.graph_model.pyc
26/04/2016  16:58            22.686 controllers.appadmin.hooks.pyc
26/04/2016  16:58            22.686 controllers.appadmin.index.pyc
26/04/2016  16:58            22.711 controllers.appadmin.insert.pyc
26/04/2016  16:58            22.711 controllers.appadmin.manage.pyc
26/04/2016  16:58            22.711 controllers.appadmin.select.pyc
26/04/2016  16:58            22.686 controllers.appadmin.state.pyc
26/04/2016  16:58            22.711 controllers.appadmin.update.pyc
26/04/2016  16:58             2.350 controllers.default.call.pyc
26/04/2016  16:58             2.370 controllers.default.download.pyc
26/04/2016  16:58             2.355 controllers.default.index.pyc
26/04/2016  16:58             2.350 controllers.default.user.pyc
26/04/2016  16:58             1.751 models.db.pyc
26/04/2016  16:58             4.890 models.menu.pyc
26/04/2016  16:58            22.962 views_appadmin.html.pyc
26/04/2016  16:58            10.826 views_default_index.html.pyc
26/04/2016  16:58             9.368 views_default_user.html.pyc
26/04/2016  16:58             8.915 views_generic.html.pyc
26/04/2016  16:58               342 views_generic.ics.pyc
26/04/2016  16:58               344 views_generic.json.pyc
26/04/2016  16:58               811 views_generic.jsonp.pyc
26/04/2016  16:58             1.083 views_generic.load.pyc
26/04/2016  16:58             3.343 views_generic.map.pyc
26/04/2016  16:58               643 views_generic.pdf.pyc
26/04/2016  16:58               342 views_generic.rss.pyc
26/04/2016  16:58               358 views_generic.xml.pyc
26/04/2016  16:58             8.160 views_layout.html.pyc
26/04/2016  16:58             1.397 views_web2py_ajax.html.pyc
26/04/2016  16:58               231 views___init__.py.pyc

Jacob Thoennes

unread,
Apr 26, 2016, 12:31:02 PM4/26/16
to web2py-users
so it looks like the "views" files have underscores but the "controllers" and "models" files have periods, and it's expecting underscores for everything. Assuming the start.bat I gave shows the same error for you, this definitely seems like a web2py bug to me. 

Niphlod

unread,
Apr 26, 2016, 5:25:42 PM4/26/16
to web2py-users
nope, once again, it doesn't show ANY errors. Why are you stating that "it's expecting underscores for everything" ?

Jacob Thoennes

unread,
Apr 26, 2016, 5:44:29 PM4/26/16
to web2py-users
the error when running my start.bat says:

IOError: [Errno 2] No such file or directory: 'applications\\init\\compiled\\controllers_default_index.pyc'

So when it tries to run the compiled app it is looking for a controller file with underscores, despite the fact that controller files should have periods (and a file does exist that has periods). 

So using my start.bat truly does not produce errors for you? What could cause such different behavior with the same files? I am running windows 10 64 bit, what other difference between our machines could cause the error? I said that I suspected a web2py bug because clearly it is generating a file name from the name of the controller file I specified, but it is not matching the file name that was produced when the app was compiled. 

Niphlod

unread,
Apr 26, 2016, 6:31:10 PM4/26/16
to web2py-users
are you using web2py_win.zip (the binary version) or the source one ?

Jacob Thoennes

unread,
Apr 26, 2016, 6:37:08 PM4/26/16
to web2py-users
I'm using the binary version. 

Niphlod

unread,
Apr 27, 2016, 2:38:48 AM4/27/16
to web2py-users
so it's another thing not different from my env.
Choose a totally different folder (if you can, change the drive too), download the binary again, compile the welcome app. hit http://127.0.0.1:8000/welcome. If it doesn't work, do a zip of the entire thing and attach it here.
For the moment, forget your bat.

Jacob Thoennes

unread,
Apr 27, 2016, 10:18:26 AM4/27/16
to web2py-users
Here it is
https://drive.google.com/open?id=0B75ZsUWhWMA2Q2RPZVhUdnJfMXM
Different folder, new web2py download, same issue. The packed welcome app doesn't have a background and the text isn't styled correctly, and the start.bat still gives the error.

Niphlod

unread,
Apr 27, 2016, 3:33:39 PM4/27/16
to web2py-users
ok, found the culprit https://github.com/web2py/web2py/pull/1194 . will open a discussion among developers to see why it got included (it's clearly wrong)

BTW: your start.bat isn't correct : -S takes app/controller/function only (no extensions).
Also, -S just starts the shell, not the webserver...

Jacob Thoennes

unread,
Apr 27, 2016, 3:35:36 PM4/27/16
to web2py-users
Thank you for looking into this. What is the correct way to open the webpage without seeing the server startup window? 

Niphlod

unread,
Apr 27, 2016, 3:54:09 PM4/27/16
to web2py-users
the "thing" that opens the page is usually the server startup window: you can start web2py without the startup window (just pass web2py.exe -a yourpassword) but it's a bit of a chicken and egg problem.... how can you be sure that a port is free (by default 8000) without having the user choose it - via the startup window - ?
Reply all
Reply to author
Forward
0 new messages