Emily K
Emily K

Reputation: 230

Pylint not working within Spyder

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!

Upvotes: 7

Views: 7918

Answers (4)

Saurabh Dadhich
Saurabh Dadhich

Reputation: 1

Pylint using F8 It is working well by pressing the F8 button once you have saved your file. Keep Analyzing

Upvotes: -1

Corvus
Corvus

Reputation: 8059

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.

Upvotes: 8

Emily K
Emily K

Reputation: 230

Previously I had been clicking into the editor and then hitting "Analyze" through the Static Code Analysis feature which was producing the error above.

If instead, I clicked on the folder within the Static Code Analysis pane and browsed to the .py file, the Static Code Analysis seemed to run appropriately without an error!

Thanks!

Upvotes: 2

rubenvb
rubenvb

Reputation: 76720

I have the same issue on Arch Linux, Python 3.4.3, PyLint 1.4.4.

If I use instead Python 2.7, it works as expected. I guess Spyder/Pylint doesn't work well with Python 3.

This is assuming you're using Python 3.

Upvotes: 0

Related Questions