Django-grappelli已安装但未显示在我的VENV的Lib/Site包中,而Django本身没有找到
我激活了Django项目的虚拟环境。
我已经使用PIP安装了Django-grappelli,将其安装到虚拟环境中。
pip install django-grappelli
调用“ PIP列表”时,我可以看到它已安装。
Package Version
---------------- -------
asgiref 3.5.2
Django 4.0.5
django-grappelli 3.0.3
pip 22.1.2
psycopg2 2.9.3
setuptools 58.1.0
sqlparse 0.4.2
tzdata 2022.1
在我的项目设置中,我按照Grappelli文档的指示添加了Grappelli应用程序:
INSTALLED_APPS = (
'grappelli',
'django.contrib.admin',
)
然后,我按照Grappelli Docs的指示添加了URL confs:
from django.conf.urls import include
urlpatterns = [
path('grappelli/', include('grappelli.urls')), # grappelli URLS
path('admin/', admin.site.urls), # admin site
]
检查是否全部好调用 py manage.py check.py check 我收到一个 modulenotfounderror:没有名为“ grappelli” 错误的模块。
我看了LIB/SITE包装,实际上, django-grappelli在那里没有显示(请参阅图片)。
我在进口的'grappelli'和'django-grappelli'的python壳中进行了测试,但python说,每个模块都没有发现。
本质上,PIP显示了它已安装,但是Python,因此Django,其他情况。
在另一个更简单的项目中测试了Grappelli,但没有遇到这个问题。显然我在这里缺少一些东西,它可能就在我的鼻子下,但是到目前为止,我感到毫无用处。我所研究的类似问题没有提供足够的启蒙。有人可以帮我吗?我正在Windows中使用Python 3.10.4。谢谢你!
I have activated a virtual environment for a Django project.
I have installed django-grappelli using pip into that virtual environment.
pip install django-grappelli
When calling 'pip list', I can see it's installed.
Package Version
---------------- -------
asgiref 3.5.2
Django 4.0.5
django-grappelli 3.0.3
pip 22.1.2
psycopg2 2.9.3
setuptools 58.1.0
sqlparse 0.4.2
tzdata 2022.1
In my project setting I added Grappelli app above Django contrib as instructed by Grappelli docs:
INSTALLED_APPS = (
'grappelli',
'django.contrib.admin',
)
Then I added the URL confs accordingly as instructed by Grappelli docs:
from django.conf.urls import include
urlpatterns = [
path('grappelli/', include('grappelli.urls')), # grappelli URLS
path('admin/', admin.site.urls), # admin site
]
When checking if it is all good calling py manage.py check I get a ModuleNotFoundError: No module named 'grappelli' error.
I looked at lib/site-packages and in fact, django-grappelli isn't showing there (see picture).
I tested in a python shell importing for 'grappelli' and 'django-grappelli' but python says no module found for each of these.
Essentially pip shows it's installed, but python, hence django, think otherwise.
Tested Grappelli in another simpler project and did not run into this problem. There is obviously something I am missing here and it is probably right under my nose, but thus far I felt useless. Similar questions I have looked at did not offer enough enlightenment. Can anyone help me, please? I am working with Python 3.10.4 in windows. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论