Upgrading python3.4 to python3.6 on ubuntu breaks pip

I managed to solve it without installing anything from sources.
Here’s what I did:

  1. First, install pip for Python3.x (for some weird reason I didn’t have it…)

    $ sudo apt-get install python3-pip
    

    It is an old version…

    $ pip3 --version
    pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4)
    
  2. … so upgrade it to the latest

    $ sudo pip3 install --upgrade pip
    

    Now it is much better

    $ sudo pip3 --version
    pip 9.0.1 from /usr/local/lib/python3.4/dist-packages (python 3.4)
    

  1. Then upgrade virtualenvvwrapper

    $ sudo pip3 install --upgrade virtualenvwrapper
    # ...
    Successfully installed pbr-3.0.1 six-1.10.0 stevedore-1.22.0 virtualenv-15.1.0 virtualenv-clone-0.2.6 virtualenvwrapper-4.7.2
    
  2. Now creating a new virtualenv works:

    $ mkvirtualenv -p `which python3.6` <VIRTUALENV_NAME>
    

    pip also works:

    $ pip install django
    # ...
    Successfully installed django-1.11.2 pytz-2017.2
    
    $ pip freeze
    Django==1.11.2
    pytz==2017.2
    

Note: Now I realize it’s a bit more than what you asked for, but (without knowing where exactly you failed) I guess you should be OK after step 2.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)