Anaconda-Python RequestsDependencyWarning:urllib3(1.22)或chardet(2.3.0)与支持的版本不匹配

Vin*_*ent 4 python pip anaconda

我收到的警告似乎没有包含在任何其他在线资源中.我安装了Anaconda Python 3.6.我在创建新的Conda环境时收到的警告是:

RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!
  RequestsDependencyWarning)
Run Code Online (Sandbox Code Playgroud)

我认为这是一个pip问题,因为可能有相关的问题(不确定它是否确实是:如何修复urllib3 RuntimeError:请求依赖'urllib3'必须是版本> = 1.21.1,<1.22?).但我得到同样的问题:

 $ conda update pip
/Users/VincentLa/anaconda3/lib/python3.6/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!
  RequestsDependencyWarning)
Run Code Online (Sandbox Code Playgroud)

Ted*_*nec 14

pip install --upgrade chardet
Run Code Online (Sandbox Code Playgroud)

可能有帮助.


evg*_*ny9 7

唯一对我有帮助的组合是(摘自http://blog.51cto.com/binuu/1948043):

pip uninstall urllib3    
pip uninstall chardet
pip install requests
Run Code Online (Sandbox Code Playgroud)

其他所有文件都无法更新chardet,因为“它已被更新”(似乎该信息已在其他位置用于该库)。


小智 4

我也有同样的问题。

原因是您的 python 实例对不同位置的不同版本的多个库感到困惑。

我遇到的这个 Ubuntu 场景也会产生你的错误。

sudo apt-get install python3-requestsa) 通过将下载源安装的 Ubuntu Python 库/usr/lib/python*/dist-packages

sudo -H pip3 install requestsb) 通过将下载源安装到 Ubuntu Python 库/usr/local/lib/python*/dist-packages

c) OS PATH & PYTHON_PATH 指向/usr/lib:/usr/local/lib

d) 由于 python 的库选择优先级,您会收到运行时警告。因此,它会警告您当前的库与/usr/local/lib位于父操作系统库位置的依赖项不兼容/usr/lib

对于您的特定场景,您似乎使用的是 MacOS,它已开箱即用地安装了 python,并通过 anaconda 进行了自定义 python 安装。

为了防止冲突,我建议您在启动 anaconda 的 python 实例时删除操作系统 python 路径 /usr/lib/python 。

这将确保它仅使用 anaconda 的 python 库,而不是来自您的操作系统。