Reputation: 141
I am trying to use Django-tables2, but my project can't find this module.
Firstly, I installed it without a problem.
(acct) C:\Users\tsjee_000\dev\acct\src>pip install django-tables2
Requirement already satisfied: django-tables2 in c:\users\tsjee_000\dev\acct\lib\site-packages
Requirement already satisfied: Django>=1.11 in c:\users\tsjee_000\dev\acct\lib\site-packages (from django-tables2)
Requirement already satisfied: pytz in c:\users\tsjee_000\dev\acct\lib\site-packages (from Django>=1.11->django-tables2)
Secondly, I added this to 'INSTALLED_APPS' in settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_tables2',
'clients',
'companies',
'report',
]
Thirdly, views.py and html templates are updated according to the tutorial.
But when I run my project it doesn't work because of the error,
ModuleNotFoundError: No module named 'django_tables2'
I think this error happens in settings.py.
FYR, 'django_tables2'module can be imported correctly in the shell mode.
Upvotes: 1
Views: 6811
Reputation: 2553
Assuming it has been installed correctly, are you sure you have activated your virtualenv? The supplied output above indicates you are using a virtualenv called acct
.
Upvotes: 1