我在多个命令上收到此错误,类似于this问题中解释的问题。但是我什至不能以sudo,non-sudo(如果就是这样)和root帐户(我专门登录到root帐户来运行它,但失败了)运行它
这是我每次都抛出的错误。
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
load_entry_point('pip==20.0.2', 'console_scripts', 'pip')()
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 96, in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/lib/python3.8/site-packages/pip/_internal/commands/freeze.py", line 12, in <module>
from pip._internal.operations.freeze import freeze
File "/usr/lib/python3.8/site-packages/pip/_internal/operations/freeze.py", line 17, in <module>
from pip._internal.req.constructors import (
File "/usr/lib/python3.8/site-packages/pip/_internal/req/__init__.py", line 11, in <module>
from .req_file import parse_requirements
File "/usr/lib/python3.8/site-packages/pip/_internal/req/req_file.py", line 25, in <module>
from pip._internal.req.constructors import (
File "/usr/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 28, in <module>
from pip._internal.req.req_install import InstallRequirement
File "/usr/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 30, in <module>
from pip._internal.operations.install.wheel import install_wheel
File "/usr/lib/python3.8/site-packages/pip/_internal/operations/install/wheel.py", line 33, in <module>
from pip._internal.utils.wheel import parse_wheel
File "/usr/lib/python3.8/site-packages/pip/_internal/utils/wheel.py", line 12, in <module>
from pip._vendor.six import PY2, ensure_str
ImportError: cannot import name 'ensure_str' from 'six' (/usr/lib/python3.8/site-packages/six.py)
注意:我最初尝试安装tensorflow,然后其他命令,例如pip freeze
和pip uninstall some-package
也会引发此错误。
我已经尝试重新安装pip,没有任何错误。我在Manjaro上,所以我跑了
pacman -Rcn python-pip
然后
pacman -S python-pip
答案 0 :(得分:1)
$ pacman -S extra/python-six
成功了!