Modulenotfounderror: no module named django_heroku error occurs because of incompatibility of psycopg2 with django_heroku package. Since psycopg2 successful installation is a hidden prerequisite for django_heroku. Generally, the dependency manager does it implicitly while installation either in wheel building or bin installs via requirements.txt. Still, if something does not go on a happy path, we get this type of error. Well! In this article, we will see the easiest trick to fix this error. So let’s begin-
Modulenotfounderror: no module named django_heroku ( Fix ) –
It is a two-step process to fix this no module named django_heroku error. Let’s address them –
Step 1: Reinstallation of psycopg2 –
We can use the pip package manager to install this psycopg2 package. Here is the simple command for this.
pip install psycopg2
It will install the latest version for psycopg2 package.
Step 2: Installing django_heroku –
This django_heroku library streamlines all the hurdles for Django application deployment with Heroku Platform as a service. Anyways, This is the final step where we install the django_heroku package. Before it, you were getting the error at this stage as the prerequisite were not compatible. But now you need to run the below command and here we go.
pip install django-heroku
Modulenotfounderror: no module named django_heroku mac m1 ( Platform specification ) –
Actually, It does not matter what platform you are using. If the root cause is the same then the solution will not vary. The platform or operating system can be Linux, Windows, or Mac. The will implies with IDE like Jupyter, Pycharm, Spyder, or any kind of software distribution like Anaconda. We need to reinstall the psycopg2 and django_heroku back to back.
Also, it is important to mention, It is not necessary to get no module named django_heroku every time with every version. It only appears when there is incompatibility with django_heroku and psycopg2.
Data Science Learner Team
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.