[英]when i run the app i am getting this error ModuleNotFoundError: No module named 'preferences' in django
[英]Why am I receiveing 'no module named wagtail' error when I try to launch django app
我有一个现有的Django项目。 我想和它一起使用Wa。 我已按照此处的说明进行操作: http : //docs.wagtail.io/zh/v1.9/getting_started/integrating_into_django.html
但是,当我尝试启动我的应用程序时,我收到来自uWSGI的以下错误消息:
*** Operational MODE: preforking ***
Traceback (most recent call last):
File "./core/wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "/opt/django/env/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
django.setup()
File "/opt/django/env/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/django/env/lib/python2.7/site-packages/django
/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/opt/django/env/lib/python2.7/site-packages/django/apps/config.py", line 116, in create
mod = import_module(mod_path)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named wagtail
unable to load app 0 (mountpoint='') (callable not found or import error)
ImportError:没有名为w的模块
但是我已经安装了w。
我发现了这个https://github.com/wagtail/wagtaildemo/issues/32
哪个建议
请您运行点冻结并将输出粘贴到此处吗?
我进行了点冻结,这是结果:-
Django==1.9.12
Pillow==3.0.0
Unidecode==0.4.20
Willow==0.4
argparse==1.2.1
assert-exists==0.0.0
backports.ssl-match-hostname==3.5.0.1
beautifulsoup4==4.5.3
caller-module==0.0.0
cp==0.0.0
distribute==0.7.3
django-appconf==1.0.1
django-autocomplete-light==3.2.1
django-compat==1.0.8
django-compressor==1.6
django-dual-authentication==1.0.0
django-hijack==2.0.1
django-htmlmin==0.8.0
django-ipware==1.1.2
django-mathfilters==0.3.0
django-modelcluster==3.0.1
django-taggit==0.22.0
django-treebeard==4.1.0
django-widget-tweaks==1.4.1
djangorestframework==3.6.2
evernote==1.25.1
html5lib==0.9999999
httplib2==0.9.2
not==1.7
oauth2==1.9.0.post1
olefile==0.44
pbr==1.8.1
public==0.0.0
publicsuffix==1.1.0
python-dateutil==2.2
pytz==2015.7
requests==2.13.0
setupfiles==0.0.0
simplejson==3.10.0
six==1.10.0
slackclient==1.0.5
stevedore==1.10.0
svn==0.3.36
uWSGI==2.0.11.2
url==0.1.5
virtualenv==13.1.2
virtualenv-clone==0.2.6
virtualenvwrapper==4.7.1
wagtail==1.9
webencodings==0.5
websocket-client==0.40.0
wheel==0.24.0
wsgiref==0.1.2
上述链接中的下一个故障排除步骤如下:-
如果在python命令行中输入以下行,会得到什么?
进口w wagtail导入wagtail.wagtailadmin; wagtail.wagtailadmin导入wagtail.wagtailforms; wagtail.wagtailforms
当我在python中运行这些命令时,结果如下:
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wagtail; wagtail
<module 'wagtail' from '/usr/local/lib/python2.7/dist-packages/wagtail/__init__.pyc'>
>>> import wagtail.wagtailadmin; wagtail.wagtailadmin
<module 'wagtail.wagtailadmin' from '/usr/local/lib/python2.7/dist-packages/wagtail/wagtailadmin/__init__.pyc'>
>>> import wagtail.wagtailforms; wagtail.wagtailforms
<module 'wagtail.wagtailforms' from '/usr/local/lib/python2.7/dist-packages/wagtail/wagtailforms/__init__.pyc'>
>>>
为什么会收到“没有模块命名为w”的错误?
看来您已经安装了两个python 2.7,也许是内置的,而手动安装了一个。 显示导入错误的代码使用位于以下位置的python:
/usr/lib/python2.7/
虽然您已安装模块的模块位于此处:
/usr/local/lib/python2.7/
您将需要将wagtail安装到第一个python或将Django Project更改为使用第二个python。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.