# Heroku throws ModuleNotFoundError for app that is installed

**URL:** <https://forum.djangoproject.com/t/heroku-throws-modulenotfounderror-for-app-that-is-installed/24237>\
**Category:** Deployment\
**Created:** [September 30, 2023, 4:14pm UTC](https://forum.djangoproject.com/t/heroku-throws-modulenotfounderror-for-app-that-is-installed/24237 "2023-09-30T16:14:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wdchild](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wdchild/32/3288_2.png) [@wdchild](https://forum.djangoproject.com/u/wdchild)\
**Post date:** [September 30, 2023, 4:14pm UTC](https://forum.djangoproject.com/t/heroku-throws-modulenotfounderror-for-app-that-is-installed/24237/1 "2023-09-30T16:14:50Z")

</div>

I am trying to deploy my first Django app to Heroku, but the environment variables are driving me nuts. I tried both environs and django-environ and in both cases I get errors that look like the following.

File “/app/.heroku/python/lib/python3.11/site-packages/django/db/utils.py”, line 153, in databases  
2023-09-30T16:06:33.120714+00:00 app[release.5173]: self.\_databases = settings.DATABASES  
2023-09-30T16:06:33.120734+00:00 app[release.5173]: ^^^^^^^^^^^^^^^^^^  
2023-09-30T16:06:33.120734+00:00 app[release.5173]: File “/app/.heroku/python/lib/python3.11/site-packages/django/conf/ **init**.py”, line 82, in **getattr**  
2023-09-30T16:06:33.120789+00:00 app[release.5173]: self.\_setup(name)  
2023-09-30T16:06:33.120789+00:00 app[release.5173]: File “/app/.heroku/python/lib/python3.11/site-packages/django/conf/ **init**.py”, line 69, in \_setup  
2023-09-30T16:06:33.120834+00:00 app[release.5173]: self.\_wrapped = Settings(settings\_module)  
2023-09-30T16:06:33.120883+00:00 app[release.5173]: ^^^^^^^^^^^^^^^^^^^^^^^^^  
2023-09-30T16:06:33.120911+00:00 app[release.5173]: File “/app/.heroku/python/lib/python3.11/site-packages/django/conf/ **init**.py”, line 170, in **init**  
2023-09-30T16:06:33.120956+00:00 app[release.5173]: mod = importlib.import\_module(self.SETTINGS\_MODULE)  
2023-09-30T16:06:33.121051+00:00 app[release.5173]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
2023-09-30T16:06:33.121064+00:00 app[release.5173]: File “/app/.heroku/python/lib/python3.11/importlib/ **init**.py”, line 126, in import\_module  
2023-09-30T16:06:33.121115+00:00 app[release.5173]: return \_bootstrap.\_gcd\_import(name[level:], package, level)  
2023-09-30T16:06:33.121230+00:00 app[release.5173]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
2023-09-30T16:06:33.121230+00:00 app[release.5173]: File “”, line 1206, in \_gcd\_import  
2023-09-30T16:06:33.121245+00:00 app[release.5173]: File “”, line 1178, in \_find\_and\_load  
2023-09-30T16:06:33.121245+00:00 app[release.5173]: File “”, line 1149, in \_find\_and\_load\_unlocked  
2023-09-30T16:06:33.121276+00:00 app[release.5173]: File “”, line 690, in \_load\_unlocked  
2023-09-30T16:06:33.121277+00:00 app[release.5173]: File “”, line 940, in exec\_module  
2023-09-30T16:06:33.121277+00:00 app[release.5173]: File “”, line 241, in \_call\_with\_frames\_removed  
2023-09-30T16:06:33.121277+00:00 app[release.5173]: File “/app/ladder/settings/dev\_settings.py”, line 16, in   
2023-09-30T16:06:33.121335+00:00 app[release.5173]: import environ  
2023-09-30T16:06:33.121357+00:00 app[release.5173]: ModuleNotFoundError: No module named ‘environ’  
2023-09-30T16:06:33.282201+00:00 heroku[release.5173]: Process exited with status 1  
2023-09-30T16:06:33.309024+00:00 heroku[release.5173]: State changed from up to complete  
2023-09-30T16:06:34.000000+00:00 app[api]: Build succeeded  
2023-09-30T16:06:35.288910+00:00 app[api]: Release v22 command failed by user

Here’s the problem. I installed the app in my environment, as well as in INSTALLED APPS. It is also in my requirements.txt. The settings are set as suggested on the django-environ website. (For environs, I followed Django for Professionals / Real Pythons website / and another set of websites, all to no avail. In the case of environs, I get the exact same error except “environs” instead of “environ” (django-environ).

If anyone has encountered this error, please let me know.

Alternatively, if anyone can suggest a fail-safe way to get things up on Heroku, I’m all ears. Having worked on this for close on 3 days I am very close to giving up on Heroku … and would be open to alternative platforms that are easier to deploy to.

Please note I’m trying to do this without Docker since allegedly all you need is venv.

Thanks in advance.
