Pylint在Spyder中不起作用 [英] Pylint not working within Spyder

查看:72
本文介绍了Pylint在Spyder中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Windows计算机上安装了Anaconda,Spyder可以正常工作,但是通过静态代码分析"功能运行pylint会出现错误.Pylint是通过Conda安装的.

I've installed Anaconda on a Windows computer and Spyder works fine, but running pylint through the Static Code Analysis feature gives an error. Pylint was installed through Conda.

注意:Spyder中的错误不允许我直接复制和粘贴文本.使用图片到文本转换器获取下面的代码,因此可能会有一些字符关闭...

Note: Error in Spyder would not allow me to copy and paste text directly. Used a picture to text converter to get the code below so there may be a few characters off...

No config file found, using default configuration Traceback (most recent call last):
File "C: \Users\ Username \AppData \Local \Continuum \Anaconda \Scripts\pylint-script.py", line 2, in <module> 
run_pylint() 
File "C: \Users\ USERNAME \AppData \Local \Continuum \Anaconda \lib\site-packages\pylint\_init_.py", line 23, in run_pylint 
Run(sys.argv[1:]) 
File "C: \Users\ USERNAME \AppData \Local \Continuum \Anaconda \lib\site-packages\pylint\lint.py", line 1313, in _init_ 
lintercheck(args) 
File "C: \Users\ USERNAME \AppData \Local \Continuum \Anaconda \lib\site-packages\pylint\lint.py", line 729, in check 
self._do_check(files_or_modules) 
File "C: \Users\ USERNAME \AppData \Local \Continuum \Anaconda \lib\site-packages\pylint\lint.py", line 831, in _do_check 
for descr in self.expand_files(files_or_modules): 
File "C: \Users\ USERNAME \AppData \Local \Continuum \Anaconda \lib\site-packages\pylint\lint.py", line 872, in expand_files 
self.add_message(key, args=message) 
File "C: \Users\ USERNAME \AppData \Local \Continuum \Anaconda \lib\site-packages\pylint\utils.py", line 390, in add_message 
self.stats['by_moduld][self.current_name][msg_cat] += 1 
KeyError: None 

有人对解决方案有任何想法吗?谢谢!

Does anyone have any thoughts on a resolution? Thank you!

推荐答案

如果您按F8键(源>运行静态代码分析),则该方法应该起作用.

If you press F8 (Source> Run Static Code Analysis) this should work.

窗格中的分析"按钮告诉它分析静态代码"分析中下拉菜单左侧的任何文件.如果那里什么也没有,那似乎会很困惑.

The analyse button in the pane tells it to analyse whatever file is in the Static code analysis drop down to the left of the button. If there is nothing in there it seems to get very confused.

按F8键会自动在下拉列表中填充当前正在编辑的文件,因此无需导航到任何位置.

Pressing F8 autopopulates the drop down with the current file being edited, so saves you navigating to wherever it is.

这篇关于Pylint在Spyder中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆