I can import crispy_forms but when I run python3 manage.py runserver
it say no module named crispy_forms, I can not why it is, because when I pip3 list, I can see django-crispy-forms.
so I attach my setup for interpreter, really need your help
interpreter setup image

and Error message in terminal

 >>> python3 manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/Users/eunwoo/anaconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/Users/eunwoo/anaconda3/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/eunwoo/anaconda3/lib/python3.7/site-packages/django/utils/autoreload.py", line 54, in wrapper
    fn(*args, **kwargs)
  File "/Users/eunwoo/anaconda3/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/Users/eunwoo/anaconda3/lib/python3.7/site-packages/django/utils/autoreload.py", line 77, in raise_last_exception
    raise _exception[1]
  File "/Users/eunwoo/anaconda3/lib/python3.7/site-packages/django/core/management/__init__.py", line 337, in execute
    autoreload.check_errors(django.setup)()
  File "/Users/eunwoo/anaconda3/lib/python3.7/site-packages/django/utils/autoreload.py", line 54, in wrapper
    fn(*args, **kwargs)
  File "/Users/eunwoo/anaconda3/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/eunwoo/anaconda3/lib/python3.7/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/Users/eunwoo/anaconda3/lib/python3.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/Users/eunwoo/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'crispy_forms'

score:-1

pip install django-crispy-forms

score:-1

pip install django-crispy-forms not works for this error. You need to use python command instead python3 for run server.

score:0

I had the same error. I had to put "crispy_forms" in double-quotes as @erdin-eray said, and then try to re-import with pip install django-crispy-forms. This solved it for me.

It turns out the first time I did a pip install ... I was not in my (env) virtual environment!

pip freeze > requirements.txt:

asgiref==3.3.1
Django==3.1.3
django-crispy-forms==1.10.0
pkg-resources==0.0.0
pytz==2020.4
sqlparse==0.4.1

score:0

If you are using pipenv and creating virtual environments for your projects, you might need to be in your virtual environment's shell. Try using

python3 -m pipenv shell

to start a shell of your virtual environment. You can check to make sure that django-crispy-forms are installed by using the

pip list

command. If you see the desired version of django-crispy-forms installed on this list, then try running the server again using the same command you were using initially:

python3 manage.py runserver

Related Query