pylint_django 抛出异常
pylint_django throwing exception
我正在使用 Python v3.6、Django v2.0,但遇到 pylint_django 的问题。
首先,如果我 运行 "pylint polls/" 到 运行 它在文件夹上 运行 没问题,并显示文件夹中所有文件的所有代码问题.由于 django 框架,有一堆 linting 错误错误地显示,我被告知使用 pylint_django 插件将摆脱这些错误。
我已经使用 "pip install 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'
有人知道我可能做错了什么吗?
谢谢
似乎 pylint>=1.8
不喜欢 pylint_django==0.7.2
,尝试使用 pip install 'pylint>=1.7,<1.8'
降级。
我正在使用 Python v3.6、Django v2.0,但遇到 pylint_django 的问题。
首先,如果我 运行 "pylint polls/" 到 运行 它在文件夹上 运行 没问题,并显示文件夹中所有文件的所有代码问题.由于 django 框架,有一堆 linting 错误错误地显示,我被告知使用 pylint_django 插件将摆脱这些错误。
我已经使用 "pip install 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'
有人知道我可能做错了什么吗?
谢谢
似乎 pylint>=1.8
不喜欢 pylint_django==0.7.2
,尝试使用 pip install 'pylint>=1.7,<1.8'
降级。