How to fix error "<type 'exceptions.ImportError'>(No module named configuration)"?

673 views
Skip to first unread message

John Davis

unread,
Nov 11, 2014, 8:45:34 AM11/11/14
to web...@googlegroups.com
Hello

I'm get the following error when I start up a web2py app:
<type 'exceptions.ImportError'>(No module named configuration)

This error corresponds to this line of code:
from configuration import local_time

This app was not written by me. It was written by someone else. It resides on a server other than the one I am using and works ok there.

I used the web2py admin interface to pack and download the app where it was working. Then I uploaded the app on a second server. I get the error on the second server when I try to start it.


John

Leonel Câmara

unread,
Nov 11, 2014, 11:41:02 AM11/11/14
to web...@googlegroups.com
Does it work if you erase all .pyc files in your application modules folder and subfolders, restart whatever is running web2py and try again?

John Davis

unread,
Nov 11, 2014, 1:56:09 PM11/11/14
to web...@googlegroups.com
On Tuesday, November 11, 2014 11:41:02 AM UTC-5, Leonel Câmara wrote:
Does it work if you erase all .pyc files in your application modules folder and subfolders, restart whatever is running web2py and try again?

I will try that.  I'm kind of waiting for the next approach to before I do that.  Here is what I noticed.

o The version of web2py on the server which works is not the same as the version on the second server.
o  If I packaged the app on the server that works and then transfer it to the new one using the admin ide webpage, the package created by packall is only 16MB.  If I tar up the entire web2py directory which includes the applicaitons/thecustom app folder, I get a whopping 3GB tar file.  I'm currently uploading that 3GB file to the new server so I can run the whole framework and app.  I'm thinking that this duplicates the web2py framework and in case there is something there which is not in the pack all operation, this will get it.
o regarding the .pyc files, i did do a clean operation in the ide. I assumed that would clear out the compile python files.  perhaps not.

 

Leonel Câmara

unread,
Nov 11, 2014, 2:08:41 PM11/11/14
to web...@googlegroups.com
Copying the entire web2py directory would work if the module was in the web2py directory site-packages, but, in that case, it also wouldn't work in the other server you used the packed application with. Clean doesn't clean the modules folder pyc files. The main reason for the size difference is probably the application's uploads folder which doesn't get packed with the application.

John Davis

unread,
Nov 11, 2014, 4:21:16 PM11/11/14
to web...@googlegroups.com
Hello Leonel,

Well after using the entire directory from the original server for web2py and installing various missing system components (mongodb, elaphe, etc.) it at least starts. I get a web2py exception later when I try to authenticate, but that is probably a user config issue.

I appreciate your tips and thank you for your time and expertise,

John

On Tue, Nov 11, 2014 at 2:08 PM, Leonel Câmara <leonel...@gmail.com> wrote:
Copying the entire web2py directory would work if the module was in the web2py directory site-packages, but, in that case, it also wouldn't work in the other server you used the packed application with. Clean doesn't clean the modules folder pyc files. The main reason for the size difference is probably the application's uploads folder which doesn't get packed with the application.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/nFx3VLWqEok/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
John F. Davis
6 Kandes Court
Durham, NC 27713

独树一帜


Reply all
Reply to author
Forward
0 new messages