Question

I'm a little bit baffled by this error I'm getting when I try to runserver or syncdb - the server was running just fine the other night when I last logged on, so I have no idea why all of a sudden it's not working. Google gave me the following page but it doesn't really address my issue.

Let me know if you need more if the console information below isn't enough. I really am not very efficient with django yet, complete beginner really, and I'm not sure why this isn't working.

Pythoness-410:auth gfleche$ python manage.py runserver
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/__init__.py", line 1, in <module>
    import collections
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/collections.py", line 8, in <module>
    from _collections import deque, defaultdict
ImportError: No module named _collections

Thank you so much and let me know.

Was it helpful?

Solution

Django is attempting to issue the following command (or some variant of it):

import collections

And is failing. This could be because your installation is missing components . You can verify it's not a django related issue by doing the following:

Pythoness-410:auth gfleche$ python
>>> import collections

If you get an error back, then it's likely to be an issue with your python installation - since collections has been around for some time, and is part of the standard install.

OTHER TIPS

Everybody was very helpful and lovely. Turns out there was some sort of issue with my entire Python install - I didn't end up reinstalling my entire OS, but only XCode, since it had been out of date since at least 2010, and this had caused a variety of other issues. Reinstalling XCode with CLI tools, installing Python 2.7, as well as reinstalling homebrew, pip and django solved my issue. Thanks very much everybody. I'm still uncertain what could have happened for my computer to make it work for almost a month and then all of a sudden crash. I'm going to keep looking for the answer why it stopped working in the first place, but I'm so happy I can finally get back to work and my django is back and running smoothly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top