Thursday, October 13, 2011

Pylint on Ubuntu

Ever see this issue?
>> from logilab.common.compat import builtins
Traceback (most recent call last):
  File "", line 1, in 
ImportError: cannot import name builtins

Chances are you have an old version of logilab that is stored inside /usr/lib/pymodules:
>>> import logilab
>>> logilab.common

>>> logilab.common.compat

>>> logilab.common.compat.__file__

The solution is to delete the logilab directory in /usr/lib/pymodules, or do:

sudo apt-get remove python-logilab-common
sudo apt-get remove python-logilab-astng

Then you can do:
pip install -U pylint

No comments:

Post a Comment