雾里看浮光
不管遇到什么事情,都要调整好自己的心态,用最好的自己重新开始,自甘堕落只会越来越糟糕!加油!

问题描述:在同步Keystone数据库时报以下错误
[root@controller ~]# su -s /bin/sh -c "keystone-manage db_sync" keystone
/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.10.2) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
Traceback (most recent call last):
File "/usr/bin/keystone-manage", line 6, in <module>
from keystone.cmd.manage import main
File "/usr/lib/python2.7/site-packages/keystone/cmd/manage.py", line 19, in <module>
from keystone.cmd import cli
File "/usr/lib/python2.7/site-packages/keystone/cmd/cli.py", line 29, in <module>
from keystone.cmd import bootstrap
File "/usr/lib/python2.7/site-packages/keystone/cmd/bootstrap.py", line 17, in <module>
from keystone.common import driver_hints
File "/usr/lib/python2.7/site-packages/keystone/common/driver_hints.py", line 18, in <module>
from keystone import exception
File "/usr/lib/python2.7/site-packages/keystone/exception.py", line 20, in <module>
import keystone.conf
File "/usr/lib/python2.7/site-packages/keystone/conf/__init__.py", line 20, in <module>
from osprofiler import opts as profiler
File "/usr/lib/python2.7/site-packages/osprofiler/opts.py", line 18, in <module>
from osprofiler import web
File "/usr/lib/python2.7/site-packages/osprofiler/web.py", line 20, in <module>
from osprofiler import profiler
File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 27, in <module>
from osprofiler import notifier
File "/usr/lib/python2.7/site-packages/osprofiler/notifier.py", line 16, in <module>
from osprofiler.drivers import base
File "/usr/lib/python2.7/site-packages/osprofiler/drivers/__init__.py", line 4, in <module>
from osprofiler.drivers import loginsight # noqa
File "/usr/lib/python2.7/site-packages/osprofiler/drivers/loginsight.py", line 25, in <module>
import requests
File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 94, in <module>
from urllib3.exceptions import DependencyWarning
ImportError: cannot import name DependencyWarning

解决方法:
[root@controller ~]# pip uninstall urllib3

[root@controller ~]# pip uninstall chardet

[root@controller ~]# pip install requests

前提:出现未找到命令先执行下面步骤
[root@controller ~]# pip unistall urllib3
bash: pip: 未找到命令...

下载pip
[root@controller ~]# wget https://bootstrap.pypa.io/get-pip.py
安装pip
[root@controller ~]# python get-pip.py
查看版本
[root@controller ~]# pip -V
查看安装路径
[root@controller ~]# find / -name pip
软链接
[root@controller ~]# ln -s /usr/lib/python2.7/site-packages/pip /usr/bin/pip

posted on 2019-12-09 14:25  雾里看浮光  阅读(1430)  评论(1编辑  收藏  举报