Pylint Not Working

162 views
Skip to first unread message

Robert Love

unread,
Jul 9, 2015, 8:40:55 AM7/9/15
to spyd...@googlegroups.com
I have Spyder installed from the latest Anaconda updates this week.   I have pylint installed using 'pip install pylint'.   I can use pylint from the command line to analyze my program.   However, from Spyder, I get a string of errors when I choose the Static code analysis tab and the Analyze button I get a long string of errors shown below.

First, is the the correct place to ask or is this an anaconda issue?

Second, I see the Spyder documentation says in the Editor section that pylint can be used but doesn't say much about how or installation.   What is the proper way to install pylint for use in spyder?


Traceback (most recent call last):

File "/Users/rlove/anaconda/bin/pylint", line 3, in <module>

run_pylint()

File "/Users/rlove/anaconda/lib/python2.7/site-packages/pylint/__init__.py", line 23, in run_pylint

Run(sys.argv[1:])

File "/Users/rlove/anaconda/lib/python2.7/site-packages/pylint/lint.py", line 1313, in __init__

linter.check(args)

File "/Users/rlove/anaconda/lib/python2.7/site-packages/pylint/lint.py", line 729, in check

self._do_check(files_or_modules)

File "/Users/rlove/anaconda/lib/python2.7/site-packages/pylint/lint.py", line 831, in _do_check

for descr in self.expand_files(files_or_modules):

File "/Users/rlove/anaconda/lib/python2.7/site-packages/pylint/lint.py", line 872, in expand_files

self.add_message(key, args=message)

File "/Users/rlove/anaconda/lib/python2.7/site-packages/pylint/utils.py", line 390, in add_message

self.stats['by_module'][self.current_name][msg_cat] += 1

KeyError: None



I don't understand what this is telling me.


Adrian Klaver

unread,
Jul 9, 2015, 9:02:26 AM7/9/15
to spyd...@googlegroups.com
On 07/08/2015 08:52 PM, Robert Love wrote:
> I have Spyder installed from the latest Anaconda updates this week. I
> have pylint installed using 'pip install pylint'. I can use pylint
> from the command line to analyze my program. However, from Spyder, I
> get a string of errors when I choose the Static code analysis tab and
> the Analyze button I get a long string of errors shown below.
>
> First, is the the correct place to ask or is this an anaconda issue?
>
> Second, I see the Spyder documentation says in the Editor section that
> pylint can be used but doesn't say much about how or installation.
> What is the proper way to install pylint for use in spyder?

First under Help --> Optional dependencies see what it shows for pylint.

Second I would think that 'pip install pylint' would install in the
system Python not Anaconda. Should you not do 'conda install or update
pylint'?

Third what OS and version and Python version are you using?
> --
> You received this message because you are subscribed to the Google
> Groups "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to spyderlib+...@googlegroups.com
> <mailto:spyderlib+...@googlegroups.com>.
> To post to this group, send email to spyd...@googlegroups.com
> <mailto:spyd...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/spyderlib.
> For more options, visit https://groups.google.com/d/optout.


--
Adrian Klaver
adrian...@aklaver.com

Robert Love

unread,
Jul 10, 2015, 1:04:36 AM7/10/15
to spyd...@googlegroups.com


On Thursday, July 9, 2015 at 8:02:26 AM UTC-5, Adrian Klaver wrote:
On 07/08/2015 08:52 PM, Robert Love wrote:
> I have Spyder installed from the latest Anaconda updates this week.   I
> have pylint installed using 'pip install pylint'.   I can use pylint
> from the command line to analyze my program.   However, from Spyder, I
> get a string of errors when I choose the Static code analysis tab and
> the Analyze button I get a long string of errors shown below.
>
> First, is the the correct place to ask or is this an anaconda issue?
>
> Second, I see the Spyder documentation says in the Editor section that
> pylint can be used but doesn't say much about how or installation.
> What is the proper way to install pylint for use in spyder?

First under Help --> Optional dependencies see what it shows for pylint.

It says pylint  1.4.2 (OK)  Static code analysis

 

Second I would think that 'pip install pylint' would install in the
system Python not Anaconda. Should you not do 'conda install or update
pylint'?

OK, I've performed the install that way.   Same results.


 

Third what OS and version and Python version are you using?

Not sure it matters.   I get the same failure on both my Mac (10.10.4) and my Mint 19 Linux box.   Both have the same recent anaconda suite with Python 2.7.
BTW, on the Mint box pylint is version 1.44
 

Adrian Klaver

unread,
Jul 10, 2015, 10:09:54 AM7/10/15
to spyd...@googlegroups.com
On 07/09/2015 06:52 PM, Robert Love wrote:
>
>
> On Thursday, July 9, 2015 at 8:02:26 AM UTC-5, Adrian Klaver wrote:
>

>
> First under Help --> Optional dependencies see what it shows for
> pylint.
>
>
> It says pylint 1.4.2 (OK) Static code analysis

So Spyder thinks pylint is of correct version, that's a start.

>
>
> Second I would think that 'pip install pylint' would install in the
> system Python not Anaconda. Should you not do 'conda install or update
> pylint'?
>
>
> OK, I've performed the install that way. Same results.

Just verifying we are talking apples to apples.

>
>
>
> Third what OS and version and Python version are you using?
>
>
> Not sure it matters. I get the same failure on both my Mac (10.10.4)
> and my Mint 19 Linux box. Both have the same recent anaconda suite
> with Python 2.7.
> BTW, on the Mint box pylint is version 1.44

It provides context and also helps narrow down whether it is an OS
specific bug for now and for those folks who wander across this thread
in the future.

So onward.

What version of Spyder are you using?
I am on 2.3.3 on openSuse 13.1 and the static analysis works.

What are you trying analyze and where is it?


The error you got:

self.stats['by_module'][self.current_name][msg_cat] += 1

KeyError: None


would seem to indicate information is missing, in that one of the above
keys is None.

--
Adrian Klaver
adrian...@aklaver.com

Robert Love

unread,
Jul 11, 2015, 9:30:46 AM7/11/15
to spyd...@googlegroups.com

Uh, we can close this out and mark it user ignorance.  I have one file in the editor, the only file I'm working on.   I assumed, that Static Analysis would automatically apply to the only  file I was working on.   No, I had to type the file name in the field at the top of the analysis pane, then it worked like a charm.

Adrian Klaver

unread,
Jul 11, 2015, 9:39:11 AM7/11/15
to spyd...@googlegroups.com
On 07/10/2015 07:15 PM, Robert Love wrote:
>
> Uh, we can close this out and mark it user ignorance. I have one file
> in the editor, the only file I'm working on. I assumed, that Static
> Analysis would automatically apply to the only file I was working on.
> No, I had to type the file name in the field at the top of the analysis
> pane, then it worked like a charm.

FYI, there is a file selector(open folder) just to the right of the file
field.



--
Adrian Klaver
adrian...@aklaver.com

Uwe Fechner

unread,
Jul 12, 2015, 9:32:57 AM7/12/15
to spyd...@googlegroups.com
Well, I would not call this user ignorance.

The current user interface is really confusing (even though I use it a lot since any years).

It would be nice, if the plugin would always run pylint on the currently open file.

Uwe Fechner
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages