0

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).

project tree

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!

Raju Ahmed
  • 1,282
  • 5
  • 15
  • 24
Fernando Soares
  • 140
  • 1
  • 12
  • Thank you Raju Ahmed for improving the question with better English! – Fernando Soares Jun 13 '22 at 14:19
  • Still working on this issue. After recreating a new venv, I decided **NOT** to upgrate pip. I used pip that comes shipped with python, instead, to make my library installs. That fixed the problem. However it's unfortunate because pip warns users to upgrade pip at every install instance. – Fernando Soares Jun 13 '22 at 23:30

0 Answers0