Why can't I import pylint?

I just installed pylint through the Cygwin package installer and can run it from the bash command line in any .py file. But if I try to programmatically import it inside a Python session, this will not work:

>>> import pylint Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named pylint 

However, if I do the following steps (which I found in the pylint command line utility file), it works:

 >>> __requires__ = 'pylint==1.3.1' >>> from pkg_resources import load_entry_point >>> import pylint >>> pylint.__file__ '/usr/lib/python2.7/site-packages/pylint-1.3.1-py2.7.egg/pylint/__init__.pyc' 

I do not need to take extra steps on several Linux systems under test. Why should I follow extra steps in Cygwin?

For informational purposes, here is my sys.path:

 $ python -c "import sys; print '\n'.join(sys.path)" /usr/lib/python2.7/site-packages/logilab_common-0.62.0-py2.7.egg /home/lance/sdp/prereqs/python/lib/python /usr/lib/python27.zip /usr/lib/python2.7 /usr/lib/python2.7/plat-cygwin /usr/lib/python2.7/lib-tk /usr/lib/python2.7/lib-old /usr/lib/python2.7/lib-dynload /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages 
+5
source share

All Articles