1

I am using PyLint for years now and have just installed PyLint 1.2.1 on Python 2.7.6

When I am running PyLint 1.2.1 (within PyScripter 2.5.3) on any Python script, I get error log:

Command line: D:\PROGRA~1\Python27\python.exe D:\PROGRA~1\Python27\Lib\site-packages\pylint-1.2.1-py2.7.egg\pylint\lint.py "E:\test\dotnetver.py" --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"
Working directory: 
Timeout: 0 ms

************* Module dotnetver
E:\test\dotnetver.py:2: [I0011(locally-disabled), ] Locally disabling missing-docstring (C0111)
No config file found, using default configuration
Traceback (most recent call last):
  File "D:\PROGRA~1\Python27\Lib\site-packages\pylint-1.2.1-py2.7.egg\pylint\lint.py", line 1106, in <module>
    Run(sys.argv[1:])
  File "D:\PROGRA~1\Python27\Lib\site-packages\pylint-1.2.1-py2.7.egg\pylint\lint.py", line 1051, in __init__
    linter.check(args)
  File "D:\PROGRA~1\Python27\Lib\site-packages\pylint-1.2.1-py2.7.egg\pylint\lint.py", line 626, in check
    self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
  File "D:\PROGRA~1\Python27\Lib\site-packages\pylint-1.2.1-py2.7.egg\pylint\lint.py", line 708, in check_astroid_module
    checker.process_module(astroid)
  File "D:\PROGRA~1\Python27\lib\site-packages\pylint-1.2.1-py2.7.egg\pylint\checkers\format.py", line 477, in process_module
    if 'print_function' in module.future_imports:
AttributeError: 'Module' object has no attribute 'future_imports'

Process "Pylint" terminated, ExitCode: 00000001

Is this a Bug in the new PyLint version or have I missed something?

hena
  • 11
  • 1
  • 4

2 Answers2

3

Upgrading astroid fixed this after a pylint upgrade

pip install  --upgrade astroid
andy boot
  • 11,355
  • 3
  • 53
  • 66
  • 1
    Specifically, fixed in astroid 1.2. Note, using astroid 1.4.3 will fail with `from astroid.utils import ASTWalker ImportError: No module named utils` – theannouncer Sep 23 '16 at 22:13
0

if using Debian or its derivatives, you may need to specifically apt-get install python-astroid. it wasn't one of the packages automatically updated by the install of pylint.

jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107