[Tutor] pip stopped working gives error

Jim jf_byrnes at comcast.net
Fri May 4 16:15:23 EDT 2018


On 05/03/2018 03:40 PM, Zachary Ware wrote:
> On Thu, May 3, 2018 at 2:10 PM, Jim <jf_byrnes at comcast.net> wrote:
>> I have python 3.6 installed in a virtual environment on Mint 18. Today I
>> wanted to use pip and got this error when I tried to use it.
>>
>>   (env36) jfb at jims-mint18 ~ $ pip help
>> Traceback (most recent call last):
>>    File "/home/jfb/EVs/env36/bin/pip", line 7, in <module>
>>      from pip import main
>>    File "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/__init__.py",
>> line 43, in <module>
>>      from pip.utils import get_installed_distributions, get_prog
>>    File
>> "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/utils/__init__.py",
>> line 23, in <module>
>>      from pip.locations import (
>>    File "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/locations.py",
>> line 9, in <module>
>>      from distutils import sysconfig
>> ImportError: cannot import name 'sysconfig'
>>
>> I searched for sysconfig and found this:
>>
>> /home/jfb/EVs/env36/lib/python3.6/site-packages/pip/_vendor/distlib/_backport/__pycache__/sysconfig.cpython-36.pyc
>> /home/jfb/EVs/env36/lib/python3.6/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg
>> /home/jfb/EVs/env36/lib/python3.6/site-packages/pip/_vendor/distlib/_backport/sysconfig.py
>>
>> The results seem to be the same as when I searched a python 3.5 virtual
>> environment I have setup.
>>
>> It has worked in the past as I have installed pylint and pykeyboard with it.
>> As I type this I just remembered Mint updated python 3.6 earlier today.
>>
>> So now I suspect the update is involved. Has anyone else experienced this
>> and know how to fix it?
> 
> First, try a clean venv (python3.6 -m venv venv && ./venv/bin/pip help).

Ok, I just tried this and got this error.

jfb at jims-mint18 ~ $ python3.6 -m venv /home/jfb/EVs/env365 && 
./venv/bin/pip help
The virtual environment was not created successfully because ensurepip 
is not
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 
python3-venv
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.

Regards,  Jim



More information about the Tutor mailing list