1

I got a small problem using pylint to check my python code. I use the opencv library in my code, which results in

E: 85: Module 'cv' has no 'MoveWindow' member

errors in my code. The reason for that is explained here : http://www.logilab.org/blogentry/78354

So I did just as they asked and created an astng_cv.py file in my code. I updated my PYTHONPATH so that he knows where my file is.

But when I try :

pylint --load-plugins astng_cv eagle_road.py

I keep having a :

ImportError: No module named astng_cv

error.

This is quite annoying and I don't really know what to do to solve the issue.

Would you have an idea?

Thanks by advance !

jlengrand
  • 12,152
  • 14
  • 57
  • 87

2 Answers2

1

put the astng_cv.py somewhere on your PYTHONPATH

gurney alex
  • 13,247
  • 4
  • 43
  • 57
  • Thanks for the tip, but that's the first thing I've done. I got some answers to write, but I have to wait for SO to let me put it ^^. 2 more hours to go – jlengrand Nov 15 '11 at 15:05
  • I think this one was long due :). – jlengrand Sep 30 '13 at 14:58
  • 1
    This is a good answer, but I don't understand why pylint behaves that way. I want the custom checker for my project to live somewhere in my project's repo, and I want my checker enabled when users type just 'pylint --rcfile=X', using the standard project rcfile. I don't want to force a fiddly custom invocation on all users, that's easily forgotten. – Jonathan Hartley Jan 19 '18 at 03:22
0

The issue seems half solved here : http://www.logilab.org/5697

I can load my module in setting the PYTHONPATH directly :

PYTHONPATH=/home/jlengrand/bin/pypath pylint --load-plugins astng_cv tippy.py

But it is quite boring to have to set it each time.

The source seems to use imp.load_source, but I coulnd't really understand in which way :s .

Still searching then^^.

jlengrand
  • 12,152
  • 14
  • 57
  • 87
  • just put the plugin in a directory which is in sys.path. The site-packages directory is a good choice (assuming you have write access in there), otherwise configure your work environment to list ~/bin/pypath in PYTHONPATH once for all, using ~/.bashrc or your shell's equivalent. – gurney alex Nov 18 '11 at 09:43