-1

i was coding with ply library for python3 in my Raspberry Pi 3 Model B with Raspbian, so i changed my default python version from 2.7 to 3.5 by using:

alias python='/usr/bin/python3.5' and then $ . ~/.bashrc

it works good the first time, but with couples test, show me the error:

Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings'

Current thread 0x76f73010 (most recent call first):

I tried to export the PYTHONHOME and PYTHONPATH by using:

export PYTHONHOME=/usr/local/lib/python3.5/ export PYTHONPATH=/usr/local/lib/python3.5/

and removing virtual environment files using:

rm -rf venv virtualenv -p /usr/bin/python3 venv/

source env/bin/activate

pip install -r requirements.txt

But it doesn't work... Anybody can help me? Thanks

Community
  • 1
  • 1
Brian Nieto
  • 273
  • 7
  • 17

1 Answers1

0

Please remove your "PYTHONHOME" and "PYTHONPATH" env settings

On Linux

unset PYTHONHOME
unset PYTHONPATH

Then Try again.

Tim Seed
  • 5,119
  • 2
  • 30
  • 26