[Tutor] pip stopped working gives error
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@jims-mint18 ~ $ pip help Traceback (most recent call last): File "/home/jfb/EVs/env36/bin/pip", line 7, in from pip import main File "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/__init__.py", line 43, in 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 from pip.locations import ( File "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/locations.py", line 9, in 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? Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] pip stopped working gives error
On 05/03/2018 01:10 PM, Jim 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@jims-mint18 ~ $ pip help > Traceback (most recent call last): > File "/home/jfb/EVs/env36/bin/pip", line 7, in > from pip import main > File > "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/__init__.py", line > 43, in > 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 > from pip.locations import ( > File > "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/locations.py", line > 9, in > 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? I heard distutils may have been split out... see if you have a package python3-distutils and if not installed, can you install it? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] pip stopped working gives error
On 05/03/2018 02:42 PM, Mats Wichmann wrote: On 05/03/2018 01:10 PM, Jim 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@jims-mint18 ~ $ pip help Traceback (most recent call last): File "/home/jfb/EVs/env36/bin/pip", line 7, in from pip import main File "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/__init__.py", line 43, in 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 from pip.locations import ( File "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/locations.py", line 9, in 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? I heard distutils may have been split out... see if you have a package python3-distutils and if not installed, can you install it? I have: //usr/lib/python3.5/distutils and //usr/lib/python3.6/distutils, but no python3-distutils. Checking in Synaptic there is no python3-distutils but there is a python3-distutils-extra. Regards, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] pip stopped working gives error
On Thu, May 3, 2018 at 2:10 PM, Jim 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@jims-mint18 ~ $ pip help > Traceback (most recent call last): > File "/home/jfb/EVs/env36/bin/pip", line 7, in > from pip import main > File "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/__init__.py", > line 43, in > 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 > from pip.locations import ( > File "/home/jfb/EVs/env36/lib/python3.6/site-packages/pip/locations.py", > line 9, in > 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). If that works, then one of the nice things about virtual environments is that they're easy to recreate, especially if you have a handy list of the packages you want, say in a `requirements.txt` file. Then all you need to do is `python3.6 -m venv --clear /path/to/your/old/venv && /path/to/your/old/venv/bin/pip install -r requirements.txt`. If you don't already have a requirements.txt file, you can create one by listing the names of the packages you want in a file, each on its own line. -- Zach ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] pip stopped working gives error
On 05/03/2018 02:27 PM, Jim wrote: >> I heard distutils may have been split out... see if you have a package >> python3-distutils and if not installed, can you install it? > > I have: > > //usr/lib/python3.5/distutils > and > //usr/lib/python3.6/distutils, but no python3-distutils. > > Checking in Synaptic there is no python3-distutils but there is a > python3-distutils-extra. it was a guess... this change seems to have just happened in Ubuntu (bionic/18.04 only), perhaps that's not the thing affecting you in Mint (yet). $ dpkg -l python3-distutils Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version ArchitectureDescription +++--===-===-= ii python3-distutils3.6.5-3 all distutils package for Python 3.x $ dpkg -L python3 | grep sysconfig $ dpkg -L python3-distutils | grep sysconfig /usr/lib/python3.6/distutils/sysconfig.py /usr/lib/python3.7/distutils/sysconfig.py $ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor