How to Solve Error Message ModuleNotFoundError : ‘crispy_forms’

Posted on

This article will discuss about how to solve a certain error. That error available by executing a certain command. That command is actually just to run a Django-based web application. Actually before executing the command, there is an additional line configuration added to the file configuration. The following is the location of that file :

C:\python\project\apps>tree .
Folder PATH listing for volume Windows
Volume serial number is E003-3593
│   └───__pycache__
    │   └───__pycache__


In the ‘’, the additional line is exist as follows :


The additional line is ‘crispy_forms’ in the last line of INSTALLED_APPS parameter. By adding and also saving the new added configuration line, the execution process begin. After executing the command for starting the Django-based application, there an error appear as follows :

(myenv) C:\python\project\apps>python runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Python38\lib\", line 932, in _bootstrap_inner
  File "C:\Python38\lib\", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\python\myenv\lib\site-packages\django\utils\", line 53, in wrapper
    fn(*args, **kwargs)
  File "C:\python\myenv\lib\site-packages\django\core\management\commands\", line 110, in inner_run
  File "C:\python\myenv\lib\site-packages\django\utils\", line 76, in raise_last_exception
    raise _exception[1]
  File "C:\python\myenv\lib\site-packages\django\core\management\", line 357, in execute
  File "C:\python\myenv\lib\site-packages\django\utils\", line 53, in wrapper
    fn(*args, **kwargs)
  File "C:\python\myenv\lib\site-packages\django\", line 24, in setup
  File "C:\python\myenv\lib\site-packages\django\apps\", line 91, in populate
    app_config = AppConfig.create(entry)
  File "C:\python\myenv\lib\site-packages\django\apps\", line 90, in create
    module = import_module(entry)
  File "C:\Python38\lib\importlib\", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1014, in _gcd_import
  File "", line 991, in _find_and_load
  File "", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'crispy_forms'
Traceback (most recent call last):
  File "", line 21, in 
  File "", line 17, in main
  File "C:\python\myenv\lib\site-packages\django\core\management\", line 401, in execute_from_command_line
  File "C:\python\myenv\lib\site-packages\django\core\management\", line 395, in execute
  File "C:\python\myenv\lib\site-packages\django\core\management\", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\python\myenv\lib\site-packages\django\core\management\commands\", line 61, in execute
    super().execute(*args, **options)
  File "C:\python\myenv\lib\site-packages\django\core\management\", line 371, in execute
    output = self.handle(*args, **options)
  File "C:\python\myenv\lib\site-packages\django\core\management\commands\", line 96, in handle**options)
  File "C:\python\myenv\lib\site-packages\django\core\management\commands\", line 103, in run
    autoreload.run_with_reloader(self.inner_run, **options)
  File "C:\python\myenv\lib\site-packages\django\utils\", line 618, in run_with_reloader
    start_django(reloader, main_func, *args, **kwargs)
  File "C:\python\myenv\lib\site-packages\django\utils\", line 603, in start_django
  File "C:\python\myenv\lib\site-packages\django\utils\", line 318, in run
  File "C:\python\myenv\lib\site-packages\django\utils\", line 324, in run_loop
  File "C:\python\myenv\lib\site-packages\django\utils\", line 364, in tick
    for filepath, mtime in self.snapshot_files():
  File "C:\python\myenv\lib\site-packages\django\utils\", line 380, in snapshot_files
    for file in self.watched_files():
  File "C:\python\myenv\lib\site-packages\django\utils\", line 278, in watched_files
    yield from iter_all_python_module_files()
  File "C:\python\myenv\lib\site-packages\django\utils\", line 105, in iter_all_python_module_files
    return iter_modules_and_files(modules, frozenset(_error_files))
  File "C:\python\myenv\lib\site-packages\django\utils\", line 141, in iter_modules_and_files
    resolved_path = path.resolve(strict=True).absolute()
  File "C:\Python38\lib\", line 1172, in resolve
    s = self._flavour.resolve(self, strict=strict)
  File "C:\Python38\lib\", line 200, in resolve
    return self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: ''

Tracing back the error message, there is one specific error message that is becoming the main hint to solve the problem. That error is ‘ModuleNotFoundError: No module named ‘crispy_forms”. So, in order to solve the problem, just install the module with the name containing ‘crispy_forms’. Before installing the module, just search the module first to be able to find the exact name of the module. Just execute the following command :

(myenv) C:\python\project\apps>pip search crispy
crispy-models (0.1.13)                    - Shared code for CRISPy web service
crispy-tailwind (0.2.0)                   - A tailwind package for Django Crispy Forms
crispy-bootstrap5 (0.1)                   - Bootstrap5 template pack for django-crispy-forms
crispy-templates (0.2.0)                  - A collection of useful templates for customizing crispy forms layouts.
django-crispy-views (1.0.1)               - crispy views for django.
django-crispy-admin (0.0.6)               - Django Crispy Admin allows you to edit your forms     with the handy
                                            crispy forms, and bootstrap3 FTW!
crispy-semantic-ui (1.0.2)                - Semantic UI template pack for crispy forms
crispy (0.7.3)                            - Core-Level Spectroscopy Simulations in Python
crispy-forms-materialize (0.2)            - Django application to add 'django-crispy-forms' layout objects for
crispy-forms-bulma (1.1.4)                - Django application to add 'django-crispy-forms' layout objects for
django-crispy-bulma (0.2)                 - Django application to add 'django-crispy-forms' layout objects for
crispy-forms-propeller (0.0.2a13)         - Django application to add 'django-crispy-forms' layout objects for
crispy-forms-foundation (0.8.0)           - Django application to add 'django-crispy-forms' layout objects for
                                            'Foundation for sites'
crispy-forms-semantic-ui (0.2.0)          - Semantic UI templates for django-crispy-forms.
crispy-forms-foundation-demo (0.5.0)      - Django application to demonstrate 'crispy-forms-foundation'
crispy-forms-gds (0.2.1)                  - Django application to add 'django-crispy-forms' layout objects for the
                                            GOV.UK Design System.
crispy-forms-bulma-django2 (1.1.5)        - Django application to add 'django-crispy-forms' layout objects for
django-crispy-contact-form (0.3.8)        - Customizable contact form based on crispy-forms with captcha support for
                                            Django 1.11+
astro-crispy (0.1.0)                      - Computational Ridge Identification with SCMS for Python
django-crispy (1.8.1)                     - Best way to have Django DRY forms
django-crispy-forms (1.10.0)              - Best way to have Django DRY forms
crispy-forms-uikit (0.2.0)                -
django-crispy-bootstrap (         - UNKNOWN
django-crispy-forms-ng (2.0.0)            - Best way to have Django DRY forms of the next generation.
django-crispy-forms-fancy-formsets (0.1)  - UNKNOWN
django_crispy_forms_registration (0.1.3)  - Library that merges Django auth, registration, and crispy
cf-pretty-form-errors (1.0.4)             - Make your crispy form errors more pretty
django-form-models (0.2.0)                - Sample models for modelling django forms and fields, and integrate with
                                            crispy forms layout.
django-slds-crispyforms (0.1.0)           - Django Crispy Forms template overrides for rendering forms using the
                                            Salesforce Lightning Design System

(myenv) C:\python\apps\apps>

As in the above command execution for searching the module that has the exact name for solving the problem, there is one module name that is suitable. That module name is in the following line :

django-crispy-forms (1.10.0)              - Best way to have Django DRY forms

So, in order to solve the problem, just install the module with the name of ‘django-crispy-forms’ as follows :

(myenv) C:\python\project\apps>pip install django-crispy-forms
Collecting django-crispy-forms
  Downloading django_crispy_forms-1.10.0-py3-none-any.whl (107 kB)
     |████████████████████████████████| 107 kB 2.2 MB/s
Installing collected packages: django-crispy-forms
Successfully installed django-crispy-forms-1.10.0
WARNING: You are using pip version 20.2.3; however, version 20.3.1 is available.
You should consider upgrading via the 'c:\python\myenv\scripts\python.exe -m pip install --upgrade pip' command.

(myenv) C:\python\project\apps>

The above module installation is actually a success, if there is no other problem the application execution should just run normally. Just re-execute the previous command for running the Django-based web application as follows :

C:\python\project\apps\ changed, reloading.
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
December 12, 2020 - 14:52:49
Django version 3.1.4, using settings 'apps.settings'
Starting development server at
Quit the server with CTRL-BREAK.

2 thoughts on “How to Solve Error Message ModuleNotFoundError : ‘crispy_forms’

Leave a Reply