最近我已将flake8
从2.3.0
更新为2.4.0
pip,将pep8
更新为1.6.2
,现在我无法运行{{1}由于flake8
不支持2.4.0
>1.6
。
有没有办法通过pip将pep8
降级到以前的版本?
错误将上限置于依赖项上。 pep8
的上限是:
2.4.0
答案 0 :(得分:3)
1.6之前的最后pep8
版本是1.5.7(参见full list of releases);使用引脚安装pip
:
pip install --force pep8==1.5.7
你会看到类似的东西:
$ pip install --force pep8==1.5.7
Collecting pep8==1.5.7
Downloading pep8-1.5.7-py2.py3-none-any.whl
Installing collected packages: pep8
Found existing installation: pep8 1.6.2
Uninstalling pep8-1.6.2:
Successfully uninstalled pep8-1.6.2
Successfully installed pep8-1.5.7
或者,让pip
为你找出1.6之前的最后一个版本:
pip install --force "pep8<1.6"
另见flake8存储库中的issue 35;另一种方法是降级flake8
:
pip install --force flake8==2.3.0
pep8
的解决方案是under way,希望很快我们就能找到解决当前泥潭的方法。
答案 1 :(得分:0)
您也可以通过以下命令安装pep8:
pip install "pep8>=1.5,<1.6"
这将安装最新版本的pep8但小于1.6且大于1.5。如果遇到任何问题,首先可以卸载pep8,然后使用上面的命令安装它。
目前我正在使用flake8 2.4.0
和pep8 1.5.7
,但它运行时没有任何问题。