首页 > Python资料 博客日记

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

2024-03-02 21:00:04Python资料围观168

文章ERROR: pip‘s dependency resolver does not currently take into account all the packages 的解决方法分享给大家,欢迎收藏Python资料网,专注分享技术知识

一、问题分析

博主在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

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


版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:jacktools123@163.com进行投诉反馈,一经查实,立即删除!

标签:

相关文章

本站推荐