1

I have a question When I ran this command heroku run python manage.py migrate

I got this error: ImportError: No module named crispy_forms

But on locally every things are doing well but my app is don't to run on Heroku please help me ?

Zulu
  • 8,765
  • 9
  • 49
  • 56

3 Answers3

3

you can also do

heroku run pip freeze

that will give you a list of installed pip apps on heroku.. but ya also check your requirements.txt file

mingle
  • 580
  • 2
  • 6
  • 24
3

I had the same issue when running heroku run python manage.py migrate command. Here is what I did and solve the issue:

  • Verify the crispy_forms in the INSTALLED_APPS under settings.py
  • Run pip install --upgrade django-crispy-forms or pip3 install --upgrade django-crispy-forms depends on the Python version you are using (pip3 is for Python version 3 and above)

If the aboves didn't work, try Daniel Roseman's suggestion:

This helped me and hope this will work for you as well. But don't forget to run (i) git add ., (ii) git commit -m "your comment", and (iii) git push heroku master before running heroku run python manage.py migrate command again.

ian0411
  • 4,115
  • 3
  • 25
  • 33
  • I am having the same problem as OP, except for `python-decouple`. I have tried steps 2 and 3 as suggested. However, I am wondering whether it is necessary to include `python-decouple` in the `INSTALLED_APPS` of `settings.py`? The README (https://github.com/henriquebastos/python-decouple) doesn't mention it, so how do we determine which modules must be included in `INSTALLED_APPS` and which don't? – Darcy Oct 20 '18 at 02:59
-1

if you haven't already, run this on your heroku platform:

pip install django-crispy-forms

remember that your local dependencies will not be installed automatically on your heroku dynos.

Jesus Gomez
  • 1,460
  • 13
  • 30