from pip._internal.cli.main import main File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site_file "/us">
赞
踩
最近更新了mac环境中anaconda下pip更新,结果重启电脑之后发现,pip崩了
错误如下:
Traceback (most recent call last): File "/Users/yuanbao/opt/anaconda3/bin/pip", line 7, in <module> from pip._internal.cli.main import main File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 8, in <module> from pip._internal.cli.autocompletion import autocomplete File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module> from pip._internal.cli.main_parser import create_main_parser File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module> from pip._internal.cli import cmdoptions File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 22, in <module> from pip._internal.cli.progress_bars import BAR_TYPES File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/cli/progress_bars.py", line 9, in <module> from pip._internal.utils.logging import get_indentation File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 14, in <module> from pip._internal.utils.misc import ensure_dir File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 29, in <module> from pip._internal.locations import get_major_minor_version, site_packages, user_site File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/locations/__init__.py", line 9, in <module> from . import _distutils, _sysconfig File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/locations/_sysconfig.py", line 8, in <module> from pip._internal.exceptions import InvalidSchemeCombination, UserInstallationInvalid ImportError: cannot import name 'InvalidSchemeCombination' from 'pip._internal.exceptions' (/Users/yuanbao/opt/anaconda3/lib/python3.8/site-packages/pip/_internal/exceptions.py)
尝试了很多方法:
pip 文件损坏导致 pip无法使用 报错 ImportError: cannot import name ‘main’ from 'pip._int
升级pip后出现ImportError: cannot import name main
最后决定恢复一下,回退版本,万一好使了呢:
恢复anaconda环境, 卸载anaconda, 重装anaconda
结果还是不可以,那没办法了只能重新安装。
mac下下载安装并使用Anaconda
没办法,环境这个问题确实是玄学,搞了一上午终于恢复到之前的环境里,不管怎么样,能重新使用就好
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。