Can't import collections because of missing <collection.py>

五迷三道 提交于 2019-12-11 12:58:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!