0

i use Python 3.6.13 and upgraded pip to pip 21.3.1 ,after this error is show :

had2000@had2000:~$ sudo pip install virtualenv virtualenvwrapper
[sudo] password for had2000:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in from pip._internal import main
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/init.py", line 40, in from pip._internal.cli.autocompletion import autocomplete
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/autocompletion.py", line 8, in from pip._internal.cli.main_parser import create_main_parser
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main_parser.py", line 12, in from pip._internal.commands import (
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/commands/init.py", line 6, in from pip._internal.commands.completion import CompletionCommand
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/commands/completion.py", line 6, in from pip._internal.cli.base_command import Command
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/base_command.py", line 25, in from pip._internal.index import PackageFinder
ImportError: cannot import name 'PackageFinder'

i also think due conflict between python 3.5 and 3.6
any help please. thank you

  • Your `pip` somehow belongs to Python 3.5, though you mention you use Python 3.6. See if you get something with `pyton3.6 -m pip install virtualenv virtualenvwrapper`. – 9769953 Dec 14 '21 at 15:31
  • Do you need Python 3.5? It is not supported anymore (for over a year currently). Since it appears to be found in `/usr/local`, check if there is indeed `/usr/local/bin/pyton3.5`. I think that could be removed (and similarly `/usr/local/bin/pip3.5`) and related symlinks as well, since no system files should depend on something installed in `/usr/local`. – 9769953 Dec 14 '21 at 15:34
  • Further note on end of life of Python versions: Python 3.6 will also not be supported in about one week (from 23 December 2021 onwards). So you may want to upgrade to a more recent Python version. See e.g. https://endoflife.date/python . – 9769953 Dec 14 '21 at 15:39
  • Reinstall `pip` for older Python: https://stackoverflow.com/a/65871131/7976758 – phd Dec 14 '21 at 15:57
  • i remove python 3.6 out of my system and it work – Dũng Hoàng Dec 17 '21 at 05:17

0 Answers0