Amon
Amon

Reputation: 2951

ModuleNotFoundError: importlib when pushing to Heroku despite local changes

I get this error when I try to push to Heroku, the traceback is: "/app/.heroku/python/lib/pytho n3.7/site-packages/appconf/utils.py", line 5, in import_attribute 2018-12-18T16:39:08.833497+00:00 app[web.1]: from django.utils.importlib import import_module

That path doesn't exist on my computer so I assume it's Heroku's own file, but I do have that same file and almost same path in my computer (it's in the directory that's linked to the remote repo. So I went to utils.py and commented out the line django.utils.importlib import import_module and replaced it from from importlib import import_module which I've learned is compatible with Python 3.

However I still receive the same error when pushing, because that file isn't updated on Heroku. How would I go about fixing that library?

Upvotes: 1

Views: 33

Answers (1)

Alasdair
Alasdair

Reputation: 308909

Try updating django-appconf in your requirements.txt or pipenv file.

This change, which is included in django-appconf v1.0+, tries to import from importlib first, so won't give that error.

Upvotes: 1

Related Questions