Python教程

python pip 依赖冲突定位

本文主要是介绍python pip 依赖冲突定位,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

今天pip安装一直遇到Jinja2冲突

可以使用pipdeptree定位冲突原因

说明文档

https://pypi.org/project/pipdeptree/

pipdeptree -r -p Jinja2 

Warning!!! Possibly conflicting dependencies found:
* Flask==2.0.0
 - Jinja2 [required: >=3.0, installed: 2.11.3]
* networkx==2.5.1
 - decorator [required: >=4.3,<5, installed: 5.0.9]
* pytest-cov==2.12.0
 - pytest [required: >=4.6, installed: 3.7.0]
------------------------------------------------------------------------
Jinja2==2.11.3
  - Flask==2.0.0 [requires: Jinja2>=3.0]
    - flasgger==0.9.5 [requires: Flask>=0.10]
    - Flask-Cors==3.0.10 [requires: Flask>=0.9]
    - Flask-Limiter==1.4 [requires: Flask>=0.8]
    - Flask-Login==0.5.0 [requires: Flask]
    - Flask-Migrate==3.0.0 [requires: Flask>=0.9]
    - Flask-Script==2.0.7 [requires: Flask]
    - Flask-SQLAlchemy==2.5.1 [requires: Flask>=0.10]
      - Flask-Migrate==3.0.0 [requires: Flask-SQLAlchemy>=1.0]
    - pytest-flask==0.15.1 [requires: Flask]
  - Sphinx==4.0.1 [requires: Jinja2>=2.3,<3.0]
    - sphinx-rtd-theme==0.5.2 [requires: sphinx]
    - sphinxcontrib-httpdomain==1.7.0 [requires: Sphinx>=1.5]

从上面可以清晰看到,Flask2要求Jinja2>=3.0,但Sphinx4.0.1要求Jinja2<3.0

https://github.com/sphinx-doc/sphinx/blob/v4.0.1/setup.py

 

 

这篇关于python pip 依赖冲突定位的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!