pylint icon indicating copy to clipboard operation
pylint copied to clipboard

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

Open Willrholmes opened this issue 1 year ago • 2 comments

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

Willrholmes avatar Feb 09 '24 12:02 Willrholmes

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

Samk13 avatar Feb 13 '24 13:02 Samk13

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

jacobtylerwalls avatar Feb 13 '24 14:02 jacobtylerwalls