# Troubleshooting Django Template Error: 'crispy-bootstrap4' Module Not Found did not work

**URL:** <https://forum.djangoproject.com/t/troubleshooting-django-template-error-crispy-bootstrap4-module-not-found-did-not-work/38590>\
**Category:** Mystery Errors\
**Created:** [February 6, 2025, 1:30am UTC](https://forum.djangoproject.com/t/troubleshooting-django-template-error-crispy-bootstrap4-module-not-found-did-not-work/38590 "2025-02-06T01:30:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![taha2samy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/taha2samy/32/23146_2.png) [@taha2samy](https://forum.djangoproject.com/u/taha2samy)\
**Post date:** [February 6, 2025, 1:30am UTC](https://forum.djangoproject.com/t/troubleshooting-django-template-error-crispy-bootstrap4-module-not-found-did-not-work/38590/1 "2025-02-06T01:30:03Z")

</div>

This is my first time working with crispy\_forms, and I encountered an issue with it:

```auto
TemplateDoesNotExist at /purchaseswe/categories/create/
bootstrap4/uni_form.html
Request Method: GET
Request URL: http://127.0.0.1:8000/purchaseswe/categories/create/
Django Version: 5.1.6
Exception Type: TemplateDoesNotExist
Exception Value: bootstrap4/uni_form.html
Exception Location: /home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/template/backends/django.py, line 130, in reraise
Raised during: purchases.views.CategoryCreateView
Python Executable: /home/Taha/.local/share/virtualenvs/store-6rOBssYB/bin/python
Python Version: 3.13.1
Python Path:
['/home/Taha/Desktop/projects/store',
 '/usr/lib64/python313.zip',
 '/usr/lib64/python3.13',
 '/usr/lib64/python3.13/lib-dynload',
 '/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib64/python3.13/site-packages',
 '/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages']
Server time: Thu, 06 Feb 2025 01:24:01 +0000

```

I searched for a solution and found that the problem could be resolved by installing the `crispy-bootstrap4` package. However, the bigger issue is that Python tells me the package is not found, even though I am using `pipenv` and am sure that it’s installed. I have tried the command multiple times and even tested it on another device with the same operating system, but the problem persists.

Here’s the error traceback that I received:

```auto
in rendered_content
    return template.render(context, self._request)
           ~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/template/backends/django.py", line 109, in render
    reraise(exc, self.backend)
    ~~~~~~~ ^^^^^^^^^^^^^^^^^^^
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/template/backends/django.py", line 130, in reraise
    raise new from exc
django.template.exceptions.TemplateDoesNotExist: bootstrap4/uni_form.html
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/usr/lib64/python3.13/threading.py", line 1041, in _bootstrap_inner
    self.run()
    ~~~~~~~~ ^^
  File "/usr/lib64/python3.13/threading.py", line 992, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
    ~~^^^^^^^^^^^^^^^^^
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/core/management/commands/runserver.py", line 126, in inner_run
    autoreload.raise_last_exception()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/core/management/ __init__.py", line 394, in execute
    autoreload.check_errors(django.setup)()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
    ~~^^^^^^^^^^^^^^^^^
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/ __init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
    ~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB/lib/python3.13/site-packages/django/apps/config.py", line 193, in create
    import_module(entry)
    ~~~~~~~~~~~~~ ^^^^^^^
  File "/usr/lib64/python3.13/importlib/ __init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'crispy-bootstrap4'

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [February 6, 2025, 2:51am UTC](https://forum.djangoproject.com/t/troubleshooting-django-template-error-crispy-bootstrap4-module-not-found-did-not-work/38590/2 "2025-02-06T02:51:22Z")

</div>

Please post the output of a `pip list` command, along with the contents of your `INSTALLED_APPS` and the `CRISPY_TEMPLATE_PACK` and `CRISPY_ALLOWED_TEMPLATE_PACKS` settings from your settings file.

Note, the most recent “released” version of crispy-bootstrap4 does not officially support Python 3.13. You may need to install the latest version from github for it to work.

---

<div class="post-metadata">

**Author:** ![taha2samy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/taha2samy/32/23146_2.png) [@taha2samy](https://forum.djangoproject.com/u/taha2samy)\
**Post date:** [February 6, 2025, 7:48am UTC](https://forum.djangoproject.com/t/troubleshooting-django-template-error-crispy-bootstrap4-module-not-found-did-not-work/38590/3 "2025-02-06T07:48:23Z")

</div>

The problem has become a bit more complicated. `pyenv` is not working on Fedora, even though the system is using Python 3.13. It feels like `pyenv` is not installed or not recognized, even with it being used.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/a/f/af70385e59ab0987ad8e1df481fb7872dbb46ec6.png)

---

<div class="post-metadata">

**Author:** ![taha2samy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/taha2samy/32/23146_2.png) [@taha2samy](https://forum.djangoproject.com/u/taha2samy)\
**Post date:** [February 6, 2025, 8:08am UTC](https://forum.djangoproject.com/t/troubleshooting-django-template-error-crispy-bootstrap4-module-not-found-did-not-work/38590/4 "2025-02-06T08:08:36Z")

</div>

I Solved the problem of pyenv but the main problem still exist

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/2/3/239f55a918e8221339288efcedf8e95bb8f0de93.png)

```auto

3.10.10 (main, Feb 6 2025, 03:08:05) [GCC 14.2.1 20250110 (Red Hat 14.2.1-7)]
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/home/Taha/.pyenv/versions/3.10.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/home/Taha/.pyenv/versions/3.10.10/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 126, in inner_run
    autoreload.raise_last_exception()
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/core/management/ __init__.py", line 394, in execute
    autoreload.check_errors(django.setup)()
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/ __init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/apps/config.py", line 193, in create
    import_module(entry)
  File "/home/Taha/.pyenv/versions/3.10.10/lib/python3.10/importlib/ __init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'crispy-bootstrap4'

```

```python
INSTALLED_APPS = [
    'django_filters',
    "purchases",
    "sales",
   'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'crispy_forms',
    "crispy-bootstrap4",
]
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap4"
CRISPY_TEMPLATE_PACK = "bootstrap4"

```

---

<div class="post-metadata">

**Author:** ![taha2samy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/taha2samy/32/23146_2.png) [@taha2samy](https://forum.djangoproject.com/u/taha2samy)\
**Post date:** [February 6, 2025, 9:11am UTC](https://forum.djangoproject.com/t/troubleshooting-django-template-error-crispy-bootstrap4-module-not-found-did-not-work/38590/5 "2025-02-06T09:11:27Z")

</div>

my pipfile

```auto
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = "*"
django-crispy-forms = "*"
django-filter = "*"

[dev-packages]

[requires]
python_version = "3.10"
python_full_version = "3.10.10"

```

```auto
{
    "_meta": {
        "hash": {
            "sha256": "21a68f877dd1f9d5e12f65178a9ce12e48318ebdcdc758233c7f39d4db2b2c9a"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_full_version": "3.10.10",
            "python_version": "3.10"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "asgiref": {
            "hashes": [
                "sha256:3e1e3ecc849832fe52ccf2cb6686b7a55f82bb1d6aee72a58826471390335e47",
                "sha256:c343bd80a0bec947a9860adb4c432ffa7db769836c64238fc34bdc3fec84d590"
            ],
            "markers": "python_version >= '3.8'",
            "version": "==3.8.1"
        },
        "django": {
            "hashes": [
                "sha256:1e39eafdd1b185e761d9fab7a9f0b9fa00af1b37b25ad980a8aa0dac13535690",
                "sha256:8d203400bc2952fbfb287c2bbda630297d654920c72a73cc82a9ad7926feaad5"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.10'",
            "version": "==5.1.6"
        },
        "django-crispy-forms": {
            "hashes": [
                "sha256:2db17ae08527201be1273f0df789e5f92819e23dd28fec69cffba7f3762e1a38",
                "sha256:efc4c31e5202bbec6af70d383a35e12fc80ea769d464fb0e7fe21768bb138a20"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.8'",
            "version": "==2.3"
        },
        "django-filter": {
            "hashes": [
                "sha256:c4852822928ce17fb699bcfccd644b3574f1a2d80aeb2b4ff4f16b02dd49dc64",
                "sha256:d8ccaf6732afd21ca0542f6733b11591030fa98669f8d15599b358e24a2cd9c3"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.8'",
            "version": "==24.3"
        },
        "sqlparse": {
            "hashes": [
                "sha256:09f67787f56a0b16ecdbde1bfc7f5d9c3371ca683cfeaa8e6ff60b4807ec9272",
                "sha256:cf2196ed3418f3ba5de6af7e82c694a9fbdbfecccdfc72e281548517081f16ca"
            ],
            "markers": "python_version >= '3.8'",
            "version": "==0.5.3"
        },
        "typing-extensions": {
            "hashes": [
                "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d",
                "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"
            ],
            "markers": "python_version >= '3.8'",
            "version": "==4.12.2"
        }
    },
    "develop": {}
}

```

i printed version of python in setting

```auto
╭─ ♥ 11:10 |       store 
╰─ pipenv run python manage.py runsever
 ////////////////////// 
 

3.10.10 (main, Feb 6 2025, 10:55:23) [GCC 14.2.1 20250110 (Red Hat 14.2.1-7)]
Traceback (most recent call last):
  File "/home/Taha/Desktop/projects/store/manage.py", line 22, in <module>
    main()
  File "/home/Taha/Desktop/projects/store/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/core/management/ __init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/core/management/ __init__.py", line 416, in execute
    django.setup()
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/ __init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/apps/config.py", line 193, in create
    import_module(entry)
  File "/home/Taha/.pyenv/versions/3.10.10/lib/python3.10/importlib/ __init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'crispy-bootstrap4'

```

i forget to install `crispy-bootstrap4` when i installed it , it does not make any thing

```auto
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = "*"
django-filter = "*"
django-crispy-forms = "*"
crispy-bootstrap4 = "*"

[dev-packages]

[requires]
python_version = "3.10"
python_full_version = "3.10.10"

```

```auto
stalling dependencies from Pipfile.lock (2b2c9a)...
All dependencies are now up-to-date!
Installing dependencies from Pipfile.lock (2b2c9a)...

  bash MEM: 56.72% | 5/7GB   8s 474ms    main ≢  ?11 
╭─ ♥ 11:14 |       store 
╰─ pipenv install crispy-bootstrap4
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
Installing crispy-bootstrap4...
✔ Installation Succeeded
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
Installing dependencies from Pipfile.lock (2b2c9a)...
All dependencies are now up-to-date!
Upgrading crispy-bootstrap4 in dependencies.
Building requirements...
Resolving dependencies...
✔ Success!
Building requirements...
Resolving dependencies...
✔ Success!
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
Installing dependencies from Pipfile.lock (215db9)...
All dependencies are now up-to-date!
Installing dependencies from Pipfile.lock (215db9)...

  bash MEM: 54.02% | 5/7GB   11s 679ms    main ≢  ?11 
╭─ ♥ 11:15 |       store 
╰─ pipenv run python manage.py runsever
 ////////////////////// 
 

3.10.10 (main, Feb 6 2025, 10:55:23) [GCC 14.2.1 20250110 (Red Hat 14.2.1-7)]
Traceback (most recent call last):
  File "/home/Taha/Desktop/projects/store/manage.py", line 22, in <module>
    main()
  File "/home/Taha/Desktop/projects/store/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/core/management/ __init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/core/management/ __init__.py", line 416, in execute
    django.setup()
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/ __init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/home/Taha/.local/share/virtualenvs/store-6rOBssYB-python/lib/python3.10/site-packages/django/apps/config.py", line 193, in create
    import_module(entry)
  File "/home/Taha/.pyenv/versions/3.10.10/lib/python3.10/importlib/ __init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'crispy-bootstrap4'

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [February 6, 2025, 1:38pm UTC](https://forum.djangoproject.com/t/troubleshooting-django-template-error-crispy-bootstrap4-module-not-found-did-not-work/38590/6 "2025-02-06T13:38:11Z")

</div>

> [@taha2samy](#):
>
> ```auto
> INSTALLED_APPS = [
> 'django_filters',
> "purchases",
> "sales",
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'crispy_forms',
> "crispy-bootstrap4",
> ]
> 
> ```

That’s the wrong app name. Quoting from the docs at [crispy-bootstrap4 · PyPI](https://pypi.org/project/crispy-bootstrap4/)

```auto
    INSTALLED_APPS = (
        ...
        "crispy_forms",
        "crispy_bootstrap4",
        ...
    )

```

(Note: The hyphen, “-”, is not an allowable character in an app name. It’s always going to be an underscore, “\_”.)
