Pylint not working within Spyder

2024/10/12 16:22:00

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.

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!

Answer

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.

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

https://en.xdnf.cn/q/69635.html

Related Q&A

WTForms doesnt validate - no errors

I got a strange problem with the WTForms library. For tests I created a form with a single field:class ArticleForm(Form):content = TextField(Content)It receives a simple string as content and now I use…

NameError: global name numpy is not defined

I am trying to write a feature extractor by gathering essentias (a MIR library) functions. The flow chart is like: individual feature extraction, pool, PoolAggregator, concatenate to form the whole fea…

Django exclude from annotation count

I have following application:from django.db import modelsclass Worker(models.Model):name = models.CharField(max_length=60)def __str__(self):return self.nameclass Job(models.Model):worker = models.Forei…

How to use yield function in python

SyntaxError: yield outside function>>> for x in range(10): ... yield x*x ... File "<stdin>", line 2 SyntaxError: yield outside functionwhat should I do? when I try to use …

Tkinter looks different on different computers

My tkinter window looks very different on different computers (running on the same resolution!):windows 8windows 7I want it to look like it does in the first one. Any ideas?My code looks like this:cla…

Sort when values are None or empty strings python

I have a list with dictionaries in which I sort them on different values. Im doing it with these lines of code:def orderBy(self, col, dir, objlist):if dir == asc:sorted_objects = sorted(objlist, key=la…

How to tell if you have multiple Djangos installed

In the process of trying to install django, I had a series of failures. I followed many different tutorials online and ended up trying to install it several times. I think I may have installed it twice…

Python Numerical Integration for Volume of Region

For a program, I need an algorithm to very quickly compute the volume of a solid. This shape is specified by a function that, given a point P(x,y,z), returns 1 if P is a point of the solid and 0 if P i…

invalid literal for int() with base 10: on Python-Django

i am learning django from official django tutorial. and i am getting this error when vote something from form. this caused from - probably - vote function under views.py here is my views.py / vote func…

How to use HTTP method DELETE on Google App Engine?

I can use this verb in the Python Windows SDK. But not in production. Why? What am I doing wrong?The error message includes (only seen via firebug or fiddler)Malformed requestor something like thatMy…