Update to python3.6 breaks pip
This happened to me on a system running Mint 18. I received an update to
python 3.6 the other day. After I applied it I could no longer use pip
in the virtual environment I set up for python3.6.
(env36) jfb at jims-mint18 ~ $ pip3
Traceback (most recent call last):
File "/home/jfb/EVs/env36/bin/pip3", line 7, in <module>
from pip import main
43, in <module>
from pip.utils import get_installed_distributions, get_prog
line 23, in <module>
from pip.locations import (
9, in <module>
from distutils import sysconfig
ImportError: cannot import name 'sysconfig'
I searched for sysconfig and found this:
These locations are the same I see in my env35 environment for python3.5.
On a python list it was suggested I try:
jfb at jims-mint18 ~ $ python3.6 -m venv /home/jfb/EVs/env365 &&
The virtual environment was not created successfully because ensurepip
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt-get install python3-venv
You may need to use sudo with that command. After installing the
package, recreate your virtual environment.
Failing command: ['/home/jfb/EVs/env365/bin/python3.6', '-Im',
'ensurepip', '--upgrade', '--default-pip']
Couple of things troubling about this message. I just checked and
python3-venv is installed, in fact I used it to install the python3.6
environment I'm having problems with. I did a search and ensurepip is on
my system at //usr/lib/python3.6/ensurepip.
I am wondering if anyone else has seen this problem and knows how to fix it.