2017-12-17 5 views
2

私はPython v3.6、Django v2.0を使用していますが、pylint_djangoに問題があります。pylint_django throwing exception

まず、 "pylint polls /"を実行してフォルダを実行すると、フォルダ内のすべてのファイルのすべてのコードの問題が表示されます。 djangoのフレームワークのせいで誤って表示されているlintingエラーがたくさんあります。pylint_djangoプラグインを使用するとこれらを取り除くことができます。

私は「pylint_djangoをインストールピップ」を使用してプラグインをインストールしているが、私は試してみて、このプラグインを使用してpylintを実行すると、そのエラー:

C:\Users\Michael\Dev\DjangoProject>pylint --load-plugins pylint_django polls/ 
Traceback (most recent call last): 
    File "c:\users\michael\appdata\local\programs\python\python36-32\Lib\runpy.py", line 193, in _run_module_as_main 
    "__main__", mod_spec) 
    File "c:\users\michael\appdata\local\programs\python\python36-32\Lib\runpy.py", line 85, in _run_code 
    exec(code, run_globals) 
    File "C:\Users\Michael\Envs\Django\Scripts\pylint.exe\__main__.py", line 9, in <module> 
    File "c:\users\michael\envs\django\lib\site-packages\pylint\__init__.py", line 16, in run_pylint 
    Run(sys.argv[1:]) 
    File "c:\users\michael\envs\django\lib\site-packages\pylint\lint.py", line 1268, in __init__ 
    linter.load_plugin_modules(self._plugins) 
    File "c:\users\michael\envs\django\lib\site-packages\pylint\lint.py", line 495, in load_plugin_modules 
    module.register(self) 
    File "c:\users\michael\envs\django\lib\site-packages\pylint_django\plugin.py", line 22, in register 
    start = name_checker.config.const_rgx.pattern[:-2] 
AttributeError: 'NoneType' object has no attribute 'pattern' 

誰もが私が間違っているかもしれないものを知っていますか?

おかげ

+0

[GitHub issue](https://github.com/landscapeio/pylint-django/issues/108) –

答えて

3

pylint>=1.8pip install 'pylint>=1.7,<1.8'を使用して、それをダウングレードしてみてください、pylint_django==0.7.2を好きではないようです。

+0

私は 'pip install pylint == 1.7'を使ってそれをソートしました。どうもありがとうございます! – Michael

関連する問題