Check the answers to this question.
The Postgres installation might have edited a required system environment variable.
Also, try installing all packages for an application into a venv to keep track of dependencies
https://docs.python.org/3/library/venv.html