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

Issue

I am seeing `"ImportError: No module named site" when deploying a Python app that worked previously.

Resolution

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

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support
Terms of Service Privacy Cookies © 2018 Salesforce.com