Gangmax Blog

ImportError: No module named 'encodings'

I encounter the “No module named ‘encodings’” error today when I run a Python program, and I found the solution here. I guess the root cause of this error is that, I upgraded my local Python version however the existing “virtualenv” is still looking for the previous Python when I start the Python program. What I need to do is to remove the existing “virtualenv” and create a new one:

1
2
3
4
rm -rf theenv
virtualenv theenv
source theenv/bin/activate
pip install -r requirements.txt

Comments