对于我的全局python实例(/usr/bin/python,而不是virtualenv),我的pyflakes部分没有运行。
flake8 --version
2.2.3 (pep8: 1.5.7, mccabe: 0.2.1) CPython 2.7.5 on Darwin看起来,薄饼似乎并没有依附于flake8。pip freeze确认已经安装了pyflakes==0.8.1。我在我的全球站点上安装了软件包($ sudo pip install flake8)。
但是,当运行在虚拟服务器内部时,pyflakes就在列表中,并且flake8按照预期的方式工作。
发布于 2014-11-02 09:09:18
康达的flake8也有类似的问题。下面是一些调试说明:
flake8在其setup.py文件中注册了吡咯烷酮检查器:
setup(
...
entry_points={
'distutils.commands': ['flake8 = flake8.main:Flake8Command'],
'console_scripts': ['flake8 = flake8.main:main'],
'flake8.extension': [
'F = flake8._pyflakes:FlakesChecker',
],
},
...在检查文件时,flake8加载已注册的“flake8.扩展名”入口点,并注册找到的检查程序:
...
for entry in iter_entry_points('flake8.extension'):
checker = entry.load()
pep8.register_check(checker, codes=[entry.name])
...conda的flake8似乎在编写这些入口点时遇到了问题。
from pkg_resources import iter_entry_points
list(iter_entry_points('flake8.extension'))为我返回一个空列表,这就是为什么pyflakes将不会注册,因此不能工作,即使它是安装的和重要的。
更新setuptools并通过pip install flake8进行安装为我解决了问题。
https://stackoverflow.com/questions/26153267
复制相似问题