My operating system is Ubuntu 17.10.
I have am trying to run (and develop) a python project, but when I do I get:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007f8c459bf740 (most recent call first):
I have tried advice from ImportError: No module named 'encodings', namely:
- I have removed old virtual environment,
- create a new one, named
venv
- run
source venv/bin/activate
pip install -r requirements.txt
Also, in pycharm, I have gone File > Settings > Project > Project Interrupter - and set this to use the same virtual environment.
I have also tried sudo dpkg-reconfigure python3
But I still get the same error.