Traceback (most recent call last):
File "/Users/test/Projects/python-language-server/output/bin/Release/osx-x64/publish/get_search_paths.py", line 31, in <module>
import site
File "/Users/test/.pyenv/versions/Py2Ansible/lib/python2.7/site.py", line 165, in <module>
main()
File "/Users/test/.pyenv/versions/Py2Ansible/lib/python2.7/site.py", line 19, in main
load_host_site()
File "/Users/test/.pyenv/versions/Py2Ansible/lib/python2.7/site.py", line 54, in load_host_site
full_path = os.path.abspath(os.path.join(here, path.encode("utf-8")))
LookupError: no codec search functions registered: can't find encoding
[email protected]:~$ python2 -m virtualenv --version
virtualenv 20.1.0 from /usr/local/lib/python2.7/dist-packages/virtualenv/__init__.pyc
[email protected]:~$ python2 -m virtualenv --quiet -p /usr/bin/python2.7 venv20
[email protected]:~$ source venv20/bin/activate
(venv20) [email protected]:~$ python -S -c 'import site'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/renat/venv20/lib/python2.7/site.py", line 164, in <module>
main()
File "/home/renat/venv20/lib/python2.7/site.py", line 19, in main
load_host_site()
File "/home/renat/venv20/lib/python2.7/site.py", line 54, in load_host_site
full_path = os.path.abspath(os.path.join(here, path.encode("utf-8")))
LookupError: no codec search functions registered: can't find encoding
(venv20) [email protected]:~$ deactivate
[email protected]:~$ sudo pip install -q 'virtualenv<20'
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
[email protected]:~$ python2 -m virtualenv --version
16.7.10
[email protected]:~$ python2 -m virtualenv --quiet -p /usr/bin/python2.7 venv16
Already using interpreter /usr/bin/python2.7
[email protected]:~$ source venv16/bin/activate
(venv16) [email protected]:~$ python -S -c 'import site'
(venv16) [email protected]:~$