Сломанный pip в Python 3.7.2

#python #python-3.x #pip #archlinux #manjaro

#python #python-3.x #pip #archlinux #manjaro

Вопрос:

Любой вызов из pip выдает у меня эту ошибку:

 Traceback (most recent call last):
  File "/usr/sbin/pip", line 11, in <module>
    load_entry_point('pip==18.1', 'console_scripts', 'pip')()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.7/site-packages/pip/_internal/__init__.py", line 40, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.py", line 22, in <module>
    from pip._internal.utils.ui import BAR_TYPES
  File "/usr/lib/python3.7/site-packages/pip/_internal/utils/ui.py", line 15, in <module>
    from pip._vendor.progress import HIDE_CURSOR, SHOW_CURSOR
ImportError: cannot import name 'HIDE_CURSOR' from 'pip._vendor.progress' (/usr/lib/python3.7/site-packages/pip/_vendor/progress/__init__.py)
  

Я использую Manjaro Linux, который основан на Arch Linux.

Ответ №1:

Просто запустите эти команды:

 sudo pacman -Rns python-pip
sudo rm -r /usr/lib/python3.7/site-packages/pip/
sudo pacman -S python-pip
  

Ссылка:https://bugs.archlinux.org/task/61930

Ответ №2:

вам нужно обновить версию pip до 19: запустите следующее:

    sudo pacman -Rns python-pip
   sudo rm -rf /usr/lib/python3.7/site-packages/pip
   sudo python3.7 -m ensurepip
   sudo pip install --upgrade pip
  

Ссылка:https://github.com/pypa/pip/issues/6261