from pip._internal.cli.main import main File "/Users/yuanbao/opt/anaconda3/lib/python3.8/site_file "/us">
当前位置:   article > 正文

mac电脑anaconda中pip更新导致pip不能使用_file "/users/yaoshuihe/opt/anaconda3/lib/python3.8

file "/users/yaoshuihe/opt/anaconda3/lib/python3.8/site-packages/requests/ad

重新安装pip

最近更新了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)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

尝试了很多方法:
pip 文件损坏导致 pip无法使用 报错 ImportError: cannot import name ‘main’ from 'pip._int
升级pip后出现ImportError: cannot import name main
最后决定恢复一下,回退版本,万一好使了呢:
恢复anaconda环境, 卸载anaconda, 重装anaconda
结果还是不可以,那没办法了只能重新安装。
mac下下载安装并使用Anaconda

重新下载包

pip下载python库太慢怎么办?

没办法,环境这个问题确实是玄学,搞了一上午终于恢复到之前的环境里,不管怎么样,能重新使用就好

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/313034
推荐阅读
相关标签
  

闽ICP备14008679号