2011/10/25 Alexandre Fayolle <[email protected]>: > On Tuesday 25 October 2011 12:02:18 Vicent Mas wrote: >> Hi, >> >> I'm using pylint-0.25 with python-2.7 in a virtual environement >> created with virtualenv-1.6.4. I've a test file, test1.py, with the >> following content: >> >> ---------------------------------------------------------------- >> #!/usr/bin/env python >> >> """This is a simple test""" >> >> from distutils.core import setup >> >> print setup >> ---------------------------------------------------------------- >> >> Running >> >> (venv-2.7)$ python test1.py >> >> works as expected. However pylint gives the following output >> >> (venv-2.7)$ pylint test1.py >> >> ************* Module test1 >> F: 5,0: Unable to import 'distutils.core' >> E: 5,0: No name 'core' in module 'distutils' >> ... >> >> and the code is rated at -6.67/10. >> >> Is this a bug? How can I avoid this problem? > > Strange, I don't reproduce and I get 10/10 on the sample code (running py2.6). > > A possible explanation could be that your pylint is running with another > version of Python (for which distutils is not available). Could you please > send the output of "pylint --version" here? >
Sure! for installing pylint I started my virtual environment and executed "pip install pylint". Installation was fine (just a few complains about some tests IIRC) so pylint should be using the Python interpreter provided by virtualenv. And it seems it does: (venv-2.7)vicent@linux-soih:~> pylint --versionpylint 0.25.0, astng 0.23.0, common 0.57.0Python 2.7 (r27:82500, Aug 07 2010, 16:54:59) [GCC](venv-2.7)vicent@linux-soih:~> pythonPython 2.7 (r27:82500, Aug 07 2010, 16:54:59) [GCC] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> from distutils.core import setup >>> print setup <function setup at 0xb723f3ac> >>> Vicent -- Share what you know, learn what you don't. _______________________________________________ Python-Projects mailing list [email protected] http://lists.logilab.org/mailman/listinfo/python-projects
