Skip to content

Instantly share code, notes, and snippets.

@wbchn
Created March 28, 2018 09:13
Show Gist options
  • Save wbchn/92ee137ec091f5ffd6a9cf4a697a0b51 to your computer and use it in GitHub Desktop.
Save wbchn/92ee137ec091f5ffd6a9cf4a697a0b51 to your computer and use it in GitHub Desktop.
Install pip for python3.6 which install with apt

Solution from https://askubuntu.com/questions/889535/how-to-install-pip-for-python-3-6-on-ubuntu-16-10

After install python3.6 via apt install python3.6, pip failure:

$ sudo pip3 install --upgrade pip
Traceback (most recent call last):
  File "/usr/bin/pip3", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1479, in <module>
    register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'

The script seems to assume that python3.6 has working setup-tools / easy install. For that reason it didn't work for me. I ended up using curl https://bootstrap.pypa.io/ez_setup.py -o - | python3.6 && python3.6 -m easy_install pip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment