Py学习  »  问与答

mac环境下的django启动问题

809618694 • 8 年前 • 3066 次点击  

操作系统:mac

python版本:安装有2.6和2.7

sys.path:包含django的安装路径

问题:django项目启动的时候出现错误如下

liuxiaochundeMac-mini:ez2_1 Liuxc$ python2.6 manage.py runserver

Traceback (most recent call last):

File "manage.py", line 7, in <module>

from django.core.management import execute_from_command_line

ImportError: No module named django.core.management

liuxiaochundeMac-mini:ez2_1 Liuxc$ python2.7 manage.py runserver

Traceback (most recent call last):

File "manage.py", line 9, in <module>

execute_from_command_line(sys.argv)

File "/Library/Python/2.7/site-packages/django/core/management/init.py", line 338, in execute_from_command_line utility.execute()

File "/Library/Python/2.7/site-packages/django/core/management/init.py", line 312, in execute django.setup()

File "/Library/Python/2.7/site-packages/django/init.py", line 18, in setup apps.populate(settings.INSTALLED_APPS)

File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry)

File "/Library/Python/2.7/site-packages/django/apps/config.py", line 112, in create mod = import_module(mod_path) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py", line 37, in import_module import(name)

ImportError: No module named django

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/1244
 
3066 次点击  
文章 [ 1 ]  |  最新文章 8 年前
mugbya
Reply   •   1 楼
mugbya    8 年前

2.7 下没有django这个模块,可以看看这个:

manage.py - ImportError: No module named django