pylint #92792 pylint cannot import zope.interface even it is in sys.path [open]
I am trying to run pylint against source code polluted by Zope imports:
************* Module youraddon.interfaces
The code in the question:
from zope.interface import Interface
And zope.interface egg is passed in sys.path for pylint as egg:
cat ../../bin/pylint|grep -i interface
Now the question is
Can I make pylint import zope.interface in a way it understands it? Why it actually fails?
If not, how can I supress import warnings and lint the rest of the file fine?
Also getting:
# E0611: 11,0: No name 'interface' in module 'zope' | |
priority | normal |
---|---|
type | bug |
done in | <not specified> |
closed by | <not specified> |
Comments
-
2012/10/31 03:15, written by anon
-
2012/10/31 03:16, written by anon
-
2012/12/05 22:10, written by anon
-
2013/01/30 18:32, written by anon
-
2013/02/22 16:30, written by sthenault
-
2013/03/05 10:10, written by dzen
-
2013/03/05 10:30, written by sthenault
-
2016/04/04 00:13, written by srikanthv2
-
2016/04/04 08:30, written by sthenault
add commentThis is reproducible as of Python 2.7.3 & zope.interface 4.0.1 on Scientific Linux 6.1
Pardon the omission from the previous post: pylint version
pylint 0.26.0,
astng 0.24.1, common 0.58.1
Python 2.7.3 (default, Oct 30 2012, 17:24:19)
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)]
make sure that you check the python version - there are cases where the shebang can call the wrong interpreter (say the system python) which can have a completely different path for site libraries. run pylint --init-hook "import sys; print sys.version" and observe the first few lines to ensure that the python version that is expected.
Hi, I have the same problem. Here's a simple test file named test.py in the current directory:
pylint -r n test.py No config file found, using default configuration ********* Module test C: 1,0: Missing docstring F: 2,0: Unable to import 'zope.interface' W: 2,0: Unused import zope
which pylint /Users/shane/.virtualenvs/publicapi/bin/pylint
I suppose this pb is related to http://www.logilab.org/ticket/8796
We've got the same errors here. having a namespace package raises a lots of F0401 errors
indeed, I've not yet found the time to dig this. This is high in my todo list though.
Hi - Is there a chance this will get done in an upcoming release? Thanks.
Hi. Pylint is now developped at github under the PyCQA umbrella : https://github.com/PyCQA/pylint
If the problem is still there with the latest release, you should search for similar tickets or create a new one there.
Thanks