Skip to content

False Positive import-error for tensorflow #2603

@petrux

Description

@petrux

Steps to reproduce

  • create a virtual env with python3.5
  • run it
  • install the latest TensorFlow and pylint via pip
  • create a file bug.py write the following code:
    import tensorflow.estimator

    if __name__ == '__main__':
        print(dir(tensorflow.estimator))
  • run pylint bug.py

Current behavior

The linter raises an error Unable to import 'tensorflow.estimator, but running the script everything works fine.

Expected behavior

No error should have been raised.

pylint --version output

pylint 2.1.1
astroid 2.0.4
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170118]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions