问题
I spent a few days to make python run on an arm board. Then I succeed to install Django on it, too. But when I used django-admin.py to start a project, error came out:
[root@FriendlyARM /]# django-admin.py
Traceback (most recent call last):
File "/usr/bin/django-admin.py", line 2, in <module>
from django.core import management
File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 1, in <module>
import collections
ImportError: No module named collections
So it's clear that I don't have collections.py in my /usr/lib/python2.5/. Fortunately I have collections.py on my PC, which belongs to python2.7.
Now the problem is, can I just copy that collections.py into my arm board? Or should I do something else like modifying my arm-linux Makefile to make sure collections.py will appear in the arm-linux version?
回答1:
No; copying over collections.py may work, but is likely only the tip of the iceberg.
Django 1.5 requires Python 2.6 or newer. Do not try to run in on Python 2.5. You could downgrade to Django 1.4 instead, which does support Python 2.5.
来源:https://stackoverflow.com/questions/17836185/cant-import-collections-because-of-missing-collection-py