0

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?

  • 3
    a) 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:10
  • OK, I'm actually trying to install frida (https://www.frida.re/docs/installation/) which requires python (recommended 3.x version) hence I installed the latest 3.6. I'm also just following the frida installation instructions (sudo pip install frida) and getting that error message. How do I install this? – user1118764 May 15 '17 at 08:14
  • 3
    Python 3 is already installed on all currently supported Ubuntu releases. On Ubuntu 14.04, you have Python 3.4. You should normally avoid installing your own Python versions, because the system heavily depends on those which are preinstalled. Note that you can always write python2 and python3 or pip2 and pip3 to specify which Python version you want. The plain python or pip without version number (must) default to version 2. – Byte Commander May 15 '17 at 08:41
  • Do you really need Python 3.6 or is Python 3.4 enough? Most modules should work with v3.4. In any case you'll need a separate Pip installation for every Python installation. – David Foerster May 17 '17 at 13:09

0 Answers0