任何来自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)
我使用基于Arch Linux的Manjaro Linux。
答案 0 :(得分:1)
只需运行以下命令:
sudo pacman -Rns python-pip
sudo rm -r /usr/lib/python3.7/site-packages/pip/
sudo pacman -S python-pip
答案 1 :(得分:0)
您需要将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