Когда я пытаюсь установить какие-либо пакеты с помощью pip или использовать pip, я получил следующую ошибку:
ImportError: cannot import name 'appdirs'
Пример:
!pip install tweepy
Traceback (most recent call last):
File "/Users/user_name/anaconda3/bin/pip", line 6,
in <module> from pip._internal.cli.main import main
File "/Users/user_name/anaconda3/lib/python3.6/site-
packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/Users/user_name/anaconda3/lib/python3.6/site-
packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/Users/user_name/anaconda3/lib/python3.6/site-
packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/Users/user_name/anaconda3/lib/python3.6/site-
packages/pip/_internal/cli/cmdoptions.py", line 25, in <module>
from pip._internal.locations import USER_CACHE_DIR, get_src_prefix
File "/Users/user_name/anaconda3/lib/python3.6/site-
packages/pip/_internal/locations.py", line 19, in <module>
from pip._internal.utils import appdirs
File "/Users/user_name/anaconda3/lib/python3.6/site-
packages/pip/_internal/utils/appdirs.py", line 13, in <module>
from pip._vendor import appdirs as _appdirs
ImportError: cannot import name 'appdirs''''
Другой пример:
`pip --version
Traceback (most recent call last):
File "/Users/user_name/anaconda3/bin/pip", line 6, in <module>
from pip._internal.cli.main import main
File "/Users/user_name/anaconda3/lib/python3.6/site-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/Users/user_name/anaconda3/lib/python3.6/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/Users/user_name/anaconda3/lib/python3.6/site
packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/Users/user_name/anaconda3/lib/python3.6/site-packages/pip/_internal/cli/cmdoptions.py", line 25, in <module>
from pip._internal.locations import USER_CACHE_DIR, get_src_prefix
File "/Users/user_name/anaconda3/lib/python3.6/site-packages/pip/_internal/locations.py", line 19, in <module>
from pip._internal.utils import appdirs
File "/Users/user_name/anaconda3/lib/python3.6/site-packages/pip/_internal/utils/appdirs.py", line 13, in <module>
from pip._vendor import appdirs as _appdirs
ImportError: cannot import name 'appdirs'
Как исправить? Спасибо