Why am I seeing "ImportError: No module named site" when deploying a Python app?


Updates to the Python buildpack mean that the PYTHONPATH and PYTHONHOME config vars being set on the app may introduce this issue.

Firstly, check if these are present with

heroku config

To fix the issue, you can unset them like so:

heroku config:unset PYTHONHOME -a cyclinganalytics
heroku config:unset PYTHONPATH -a cyclinganalytics