I'm trying to install python 3.6.1 on my Ubuntu 14.04 VM. I use the following commands:
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6
It installs successfully, however I believe I still have 2.7 installed, because when I run "sudo pip" it gives the following error:
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 61, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
EOFError: EOF read where object expected
How do I resolve this?
pip
is for python2,pip3
is for python3, and b)/usr/local/lib/
indicates you installed Python from source. That's always going to cause trouble. – muru May 15 '17 at 08:10python2
andpython3
orpip2
andpip3
to specify which Python version you want. The plainpython
orpip
without version number (must) default to version 2. – Byte Commander May 15 '17 at 08:41