Strange new error

17 views
Skip to first unread message

Gchorn

unread,
Nov 16, 2011, 3:01:44 PM11/16/11
to Django users
Hi All,

So I haven't used Django in a while (like three months), and when I
tried firing up a project in dev from Terminal (in OSX) today using
the "python manage.py runserver" command, I got the following
Traceback:

File "manage.py", line 14, in <module>
execute_manager(settings)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/django/core/management/__init__.py", line 438,
in execute_manager
utility.execute()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/django/core/management/__init__.py", line 379,
in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/django/core/management/__init__.py", line 261,
in fetch_command
klass = load_command_class(app_name, subcommand)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/django/core/management/__init__.py", line 67,
in load_command_class
module = import_module('%s.management.commands.%s' % (app_name,
name))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/django/utils/importlib.py", line 35, in
import_module
__import__(name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/django/core/management/commands/runserver.py",
line 8, in <module>
from django.core.handlers.wsgi import WSGIHandler
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/django/core/handlers/wsgi.py", line 12, in
<module>
from django.core.handlers import base
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/django/core/handlers/base.py", line 7, in
<module>
from django.utils.log import getLogger
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/django/utils/log.py", line 1, in <module>
import logging
ImportError: No module named logging

Has anyone ever seen this? I have no idea what it means. I haven't
messed with my installation of Django so I don't know why it wouldn't
be able to find all of the modules it previously could. Any ideas?

-Guillaume

Tom Evans

unread,
Nov 16, 2011, 3:32:18 PM11/16/11
to django...@googlegroups.com
On Wed, Nov 16, 2011 at 3:01 PM, Gchorn <guillau...@gmail.com> wrote:
> Hi All,
>
> So I haven't used Django in a while (like three months), and when I
> tried firing up a project in dev from Terminal (in OSX) today using
> the "python manage.py runserver" command, I got the following
> Traceback:
>
>  File "manage.py", line 14, in <module>
> …

>  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
> python2.7/site-packages/django/utils/log.py", line 1, in <module>
>    import logging
> ImportError: No module named logging
>
> Has anyone ever seen this?  I have no idea what it means.  I haven't
> messed with my installation of Django so I don't know why it wouldn't
> be able to find all of the modules it previously could.  Any ideas?
>

logging is a core part of python itself since python 2.3, have you
accidentally trashed your python site directory? What is in
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/
?

http://docs.python.org/library/logging.html

Cheers

Tom

Gchorn

unread,
Nov 16, 2011, 10:55:40 PM11/16/11
to Django users
Weird, when I navigate to that folder, it hangs as though it's having
to load up a ton of files, and then after a lengthy pause it shows 0
items. I don't know how I could have erased the contents of this
folder as I have never opened it (or why it's hanging every time I try
to open it). The only significant activity on my computer recently is
that I have begun using Mac's Time Machine program to make backups.
Could that have done anything? Otherwise I have just been doing basic
scripting exercises in IDLE. There isn't some way I could have
accidentally emptied that folder from the interpreter is there?

thanks,
Guillaume

On Nov 16, 11:32 pm, Tom Evans <tevans...@googlemail.com> wrote:

Mike Dewhirst

unread,
Nov 16, 2011, 11:39:40 PM11/16/11
to django...@googlegroups.com
On 17/11/2011 9:55am, Gchorn wrote:
> Weird, when I navigate to that folder, it hangs as though it's having
> to load up a ton of files, and then after a lengthy pause it shows 0
> items. I don't know how I could have erased the contents of this
> folder as I have never opened it (or why it's hanging every time I try
> to open it). The only significant activity on my computer recently is
> that I have begun using Mac's Time Machine program to make backups.
> Could that have done anything? Otherwise I have just been doing basic
> scripting exercises in IDLE. There isn't some way I could have
> accidentally emptied that folder from the interpreter is there?

Sounds to me like a trashed disk on a Windows machine. I suppose OSX
might behave like that too - although I would hope to see an error
message of some sort. Do you have any disk analysis utilities?

Mike


>
> thanks,
> Guillaume
>
> On Nov 16, 11:32 pm, Tom Evans<tevans...@googlemail.com> wrote:
>> On Wed, Nov 16, 2011 at 3:01 PM, Gchorn<guillaumech...@gmail.com> wrote:
>>> Hi All,
>>
>>> So I haven't used Django in a while (like three months), and when I
>>> tried firing up a project in dev from Terminal (in OSX) today using
>>> the "python manage.py runserver" command, I got the following
>>> Traceback:
>>
>>> File "manage.py", line 14, in<module>

>>> �

Gchorn

unread,
Nov 17, 2011, 1:03:33 AM11/17/11
to django...@googlegroups.com
I'm sorry, it's not totally clear to me what you mean by "trashed disk." If I use a disk utility, what am I looking for? Some sort of corruption of the actual hard drive? Are you saying my hard drive itself might be compromised and need replacement?

Thanks,
Guillaume

Mike Dewhirst

unread,
Nov 17, 2011, 3:57:10 AM11/17/11
to django...@googlegroups.com

I think it *might* be damaged. One cannot be sure without exercising it
with a utility designed to discover such problems. If it is damaged it
will need to be repaired if possible so you can recover data before it
gets lost. I have used Spinwrite for this in the past successfully.

On the other hand if you have a backup you might be quite relaxed if
whatever utility you choose actually does report a bad disk.

I'm basing this on your earlier comment that you didn't empty the
directory yourself and it is taking a long time to display. An empty
directory should display pretty promptly.

Mike

>
> Thanks, Guillaume
>

Gchorn

unread,
Nov 17, 2011, 10:48:59 PM11/17/11
to django...@googlegroups.com
You were absolutely right. I used the built-in disk utility for OSX to verify the drive and it was corrupt. I then tried to use said utility to repair the disk but it couldn't, and recommended a reformat instead. Yikes. Was it fate that this happened literally a day after I started using Time Machine to back up my computer?

Actually, the more important question I have (and one which I know this list isn't really the best forum for, so my apologies), is how might something like this have happened? Is hard drive corruption like this a common occurrence, and can it be avoided?

Either way thanks to everyone for the helpful comments.

Mike Dewhirst

unread,
Nov 17, 2011, 11:44:35 PM11/17/11
to django...@googlegroups.com
On 18/11/2011 9:48am, Gchorn wrote:
> Is hard drive corruption like this a common occurrence, and can it be avoided?

http://en.wikipedia.org/wiki/Hard-disk_failure

http://static.googleusercontent.com/external_content/untrusted_dlcp/labs.google.com/en//papers/disk_failures.pdf

ymmv

mike

Reply all
Reply to author
Forward
0 new messages