Virtualenv gives an error after updating Ubuntu

I have used the python virtual environment (virtualenv) successfully for some time. I just upgraded to the new version of Ubuntu and it ruined my environment. I got the impression that the virtual person was self-sufficient, but apparently I was wrong. :)

Here's the error:

Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings' Aborted (core dumped) 

I thought that maybe this is due to the fact that Ubuntu changed from Python 3.4 to 3.5, so I tried to change the version I use with

  virtualenv --python=/usr/bin/python3.5 py3default 

but it will not update Python for me.

Note: this one looks like a duplicate, but has no solution yet.

+5
source share
1 answer

This is because your python has been upgraded to python3 by default, in my case python3.5, so for the solution you need to install virtualenv from pip3 like this.

 pip3 install virtualenv 

I ran into this problem after upgrading my Ubuntu 14.04 LTS to 16.04 LTS.

Hope this helps.

0
source

Source: https://habr.com/ru/post/1247796/


All Articles