Django - “no module named django.core.management”

在使用Django启动实例应用时,报错:no module named django.core.management

(cmdb)root@ubuntu:/home/xiaofei/cmdb/django-webblog/djblog# ./manage.py syncdb
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

谷歌查询得知:

(cmdb)root@ubuntu:/home/xiaofei/cmdb/django-webblog/djblog# sudo ./manage.py startapp blog
(cmdb)root@ubuntu:/home/xiaofei/cmdb/django-webblog/djblog# sudo ./manage.py syncdb
Creating tables ...
Creating table django_admin_log
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): 
Email address: 
Password: 
Password (again): 
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

也有说是python版本不对或可在manage.py中指定python路径,客官均可以试试。

你可能感兴趣的:(django,python,Blog)