运行pip3时,无法导入名称“ requests”

时间:2018-07-15 19:06:24

标签: python linux pip

自从最近更新以来,我对pip3不再能做任何事情:

$ pip3
Traceback (most recent call last):
  File "/usr/bin/pip3", line 11, in <module>
    load_entry_point('pip==10.0.1', 'console_scripts', 'pip3')()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
    return self.resolve()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.6/site-packages/pip/_internal/__init__.py", line 42, in <module>
    from pip._internal import cmdoptions
  File "/usr/lib/python3.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
    from pip._internal.index import (
  File "/usr/lib/python3.6/site-packages/pip/_internal/index.py", line 15, in <module>
    from pip._vendor import html5lib, requests, six
ImportError: cannot import name 'requests'

无论我给pip3提供什么参数,都会发生同样的错误。

我尝试过:

sudo pacman -S python-requests

哪个没用。同样的错误。我也尝试过:

sudo pacman -Rdd python-pip
sudo pacman -Rdd python
sudo pacman -S python-pip python

但同样的错误。

我在这里迷路了,为什么不能完全重新安装与之相关的所有文件以解决问题?如何使pip3再次正常工作?

哦,如果重要的话,我正在运行manjaro。

0 个答案:

没有答案