pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.29k stars 1.13k forks source link

False positive: import-error and no-name-in-module when importing from python-docx #9426

Open Willrholmes opened 8 months ago

Willrholmes commented 8 months ago

Bug description

docx.api import Document

Configuration

[MAIN]

jobs=0

disable=raw-checker-failed,
        locally-disabled,
        file-ignored,
        suppressed-message,
        deprecated-pragma,
        missing-function-docstring,
        missing-class-docstring,
        missing-module-docstring,
        too-few-public-methods,
        line-too-long,
        no-else-return,
        protected-access,
        fixme,
    wrong-import-order,
        duplicate-code

Command used

pylint ${SRC_HOME} ${TEST_HOME} type_stubs

Pylint output

E0401: Unable to import 'docx.api' (import-error)
E0611: No name 'api' in module 'docx' (no-name-in-module)
E0401: Unable to import 'docx.document' (import-error)
E0611: No name 'document' in module 'docx' (no-name-in-module)

### Expected behavior

No error

### Pylint version

```shell
pylint 3.0.3
asteroid 3.0.3
Python 3.12.1

OS / Environment

macOS 14.2.1

Additional dependencies

python-docs==0.8.11
Samk13 commented 8 months ago

This command works for me in VS Code: ctr p: >pylint: Restart Server.

jacobtylerwalls commented 8 months ago

It's possible #9428 will help. Please retest once pylint 3.1is out. Thanks!