ERROR: pip‘s dependency resolver does not currently take into account all the packages 的解决方法

一、问题分析

博主在PyCharm中使用pip命令 pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple 安装项目所需的依赖包,出现:ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.

anaconda-project 0.9.1 requires ruamel-yaml, which is not installed.
notebook 6.3.0 requires tornado>=6.1, but you have tornado 5.1.1 which is incompatible.
jupyterlab 3.0.14 requires tornado>=6.1.0, but you have tornado 5.1.1 which is incompatible.
jupyter-server 1.4.1 requires tornado>=6.1.0, but you have tornado 5.1.1 which is incompatible.
distributed 2021.4.0 requires tornado>=6.0.3; python_version >= “3.8”, but you have tornado 5.1.1 which is incompatible.


在这里插入图片描述

从以上报错信息来看,博主环境中已安装的 notebook 6.3.0、jupyterlab 3.0.14、jupyter-server 1.4.1、distributed 2021.4.0 这几个版本的包与我现在安装 requirements.txt中的项目依赖包 qt4c、qt4w所需要的 tornado 版本不一致,说白了就是你python环境中的部分包与 tornado>=6.1.0 版本兼容,而你现在安装的项目所需要的包与 tornado==5.1.1 版本兼容,这就是问题所在。

同理现在我们安装 tornado>=6.1.0 版本,就会提示 qt4w 2.1.5tornado>=6.1.0 不兼容。

在这里插入图片描述

二、解决方法

通过以上问题分析,比较好的解决方法就是卸载不兼容 tornado==5.1.1 的包,即 notebook 6.3.0、jupyterlab 3.0.14、jupyter-server 1.4.1、distributed 2021.4.0,再重新安装即可(安装时不指定版本);因为qt4c、qt4w所需要的 tornado 版本只能是 5.1.1,所以为了兼顾两边,只能选择卸载重装。

卸载 控制台中提示不存在兼容的所有包

pip uninstall tornado
pip uninstall notebook jupyterlab jupyter-server distributed
pip uninstall -r requirements.txt

安装 code>tornado==5.1.1 版本

pip install tornado==5.1.1 -i https://pypi.tuna.tsinghua.edu.cn/simple/

安装 notebook jupyterlab jupyter-server distributed

pip install notebook jupyterlab jupyter-server distributed -i https://pypi.tuna.tsinghua.edu.cn/simple/

安装 requirements.txt中的项目依赖包

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/

另外一种方法:其实我们通过pip命令在安装包时经常会出现不兼容的提示,可以将本地pip版本进行升级后,再进行尝试安装~

python -m pip install --upgrade pip

最后说明一点:其实出现不兼容的情况,也是可以忽略不计的,虽然提示了不兼容,但是实际是安装成功的~

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
青葱年少的头像青葱年少普通用户
上一篇 2023年3月5日
下一篇 2023年3月5日

相关推荐