Django shop error: "No module named shop"
Django shop error: "No module named shop"
当我启动 django 商店时,我收到一条错误消息:ImportError: No module named shop
。
- 我已经切换到我的项目目录;
- 已激活
virtualenv
;
- 已安装
django-shop
,使用 pip install django-shop
;
- 在我的项目目录中将模块
shop
添加到 settings.py
;
- 在我的
urls.py
中添加了一个字符串(r'^shop/', include('shop.urls')),
。
一切正常,没有错误。任何建议如何解决该问题?
已安装的应用程序列表来自 settings.py:
'INSTALLED_APPS = (
'djangocms_admin_style',
'djangocms_text_ckeditor',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'cms',
'menus',
'sekizai',
'treebeard',
'djangocms_style',
'djangocms_column',
'djangocms_file',
'djangocms_flash',
'djangocms_googlemap',
'djangocms_inherit',
'djangocms_link',
'djangocms_picture',
'djangocms_teaser',
'djangocms_video',
'reversion',
'shop',
'shop.addressmodel',
'eshop',
)'
这是 pip freeze --local
结果:
dj-database-url==0.3.0
Django==1.7.10
django-classy-tags==0.6.2
django-cms==3.1.2
django-reversion==1.8.5
django-sekizai==0.8.2
Django-Select2==4.3.1
django-treebeard==3.0
djangocms-admin-style==0.2.7
djangocms-column==1.5
djangocms-file==0.1
djangocms-flash==0.2.0
djangocms-googlemap==0.3
djangocms-inherit==0.1
djangocms-installer==0.7.9
djangocms-link==1.6.2
djangocms-picture==0.1
djangocms-style==1.5
djangocms-teaser==0.1
djangocms-text-ckeditor==2.6.0
djangocms-video==0.1
html5lib==0.999999
Pillow==2.9.0
pytz==2015.4
six==1.9.0
tzlocal==1.2
wheel==0.24.0
来自终端的回溯:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
django.setup()
File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/apps/config.py", line 87, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named shop
您的 pip freeze 未显示已安装 django-shop。
确定安装成功吗?
当我启动 django 商店时,我收到一条错误消息:ImportError: No module named shop
。
- 我已经切换到我的项目目录;
- 已激活
virtualenv
; - 已安装
django-shop
,使用pip install django-shop
; - 在我的项目目录中将模块
shop
添加到settings.py
; - 在我的
urls.py
中添加了一个字符串(r'^shop/', include('shop.urls')),
。
一切正常,没有错误。任何建议如何解决该问题?
已安装的应用程序列表来自 settings.py:
'INSTALLED_APPS = (
'djangocms_admin_style',
'djangocms_text_ckeditor',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'cms',
'menus',
'sekizai',
'treebeard',
'djangocms_style',
'djangocms_column',
'djangocms_file',
'djangocms_flash',
'djangocms_googlemap',
'djangocms_inherit',
'djangocms_link',
'djangocms_picture',
'djangocms_teaser',
'djangocms_video',
'reversion',
'shop',
'shop.addressmodel',
'eshop',
)'
这是 pip freeze --local
结果:
dj-database-url==0.3.0
Django==1.7.10
django-classy-tags==0.6.2
django-cms==3.1.2
django-reversion==1.8.5
django-sekizai==0.8.2
Django-Select2==4.3.1
django-treebeard==3.0
djangocms-admin-style==0.2.7
djangocms-column==1.5
djangocms-file==0.1
djangocms-flash==0.2.0
djangocms-googlemap==0.3
djangocms-inherit==0.1
djangocms-installer==0.7.9
djangocms-link==1.6.2
djangocms-picture==0.1
djangocms-style==1.5
djangocms-teaser==0.1
djangocms-text-ckeditor==2.6.0
djangocms-video==0.1
html5lib==0.999999
Pillow==2.9.0
pytz==2015.4
six==1.9.0
tzlocal==1.2
wheel==0.24.0
来自终端的回溯:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
django.setup()
File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/apps/config.py", line 87, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named shop
您的 pip freeze 未显示已安装 django-shop。 确定安装成功吗?