Could not find platform independent libraries
Could not find platform dependent libraries
Consider setting $PYTHONHOME to [:]
Python version: 3.5.4 |Continuum Analytics, Inc.| (default, Aug 14 2017, 13:26:58) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
Set PythonHome to /opt/anaconda
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
It turned out that the problem was in the binary code of uwsgi in my environment. It was compiled for another environment, with the environment path hard-coded in. Yes, in the binary. I had done that in another environment and the compiled package stayed in the pip cache, and the new environment just picked it up from the cache, causing inconsistency!
The solution:
pip install --no-cache uwsgi