[Python] Django – “no module named django.core.management”

利用 django-admin.py 建立一個新專案後,準備要在專案目錄底下用 manage.py 開始做事情時,出現了詭異的錯誤訊息:

$ python manage.py
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

 

錯誤訊息中的大意是找不到 django.core.management 這個 module,利用下面的指令檢查一下 module source:

$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
/usr/lib/python2.7/site-packages

Read more “[Python] Django – “no module named django.core.management””