본문 바로가기
how to

how to fix pip3 error : ImportError: cannot import name 'PackageFinder' from 'pip._internal.index'

by 즉흥 2022. 1. 30.
728x90
반응형
Traceback (most recent call last):

  File "/Library/Developer/CommandLineTools/usr/bin/pip3", line 6, in <module>

    from pip.\_internal import main

  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/\_internal/\_\_init\_\_.py", line 40, in <module>

    from pip.\_internal.cli.autocompletion import autocomplete

  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/\_internal/cli/autocompletion.py", line 8, in <module>

    from pip.\_internal.cli.main\_parser import create\_main\_parser

  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/\_internal/cli/main\_parser.py", line 11, in <module>

    from pip.\_internal.commands import (

  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/\_internal/commands/\_\_init\_\_.py", line 6, in <module>

    from pip.\_internal.commands.completion import CompletionCommand

  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/\_internal/commands/completion.py", line 6, in <module>

    from pip.\_internal.cli.base\_command import Command

  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/\_internal/cli/base\_command.py", line 26, in <module>

    from pip.\_internal.index import PackageFinder

ImportError: cannot import name 'PackageFinder' from 'pip.\_internal.index' (/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/\_internal/index/\_\_init\_\_.py)

pip3을 사용하려고 했는데 위와 같은 에러가 발생.

되던게 갑자기 안 되서 당황했는데 해결책은 간단했다.

curl [https://bootstrap.pypa.io/get-pip.py](https://bootstrap.pypa.io/get-pip.py) -o get-pip.py  
python3 get-pip.py  
rm get-pip.py  
728x90
반응형

댓글