neoclide / coc-python

Python extension for coc.nvim, fork of vscode-python
574 stars 51 forks source link

E0401 errors are not mitigated with the "python.autoComplete.extraPaths" configuration option #208

Closed ghost closed 4 years ago

ghost commented 4 years ago

Consider a directory with the following structure

$ tree $(pwd)
/home/beep1560/mytest
├── main.py
└── my_dir
    └── my_module.py

1 directory, 2 files

whose files have the following content

$ cat main.py
from my_module import foo
foo()
$ cat my_dir/my_module.py
def foo():
    print("foo")

Now, consider the following ~/.vim/coc-settings.json

{
    "python.autoComplete.extraPaths": [ "/home/beep1560/mytest/my_dir" ]
}

Opening main.py shows the following error (see image below)

image

Isn't it supposed that the python.autoComplete.extraPaths configuration option is used to avoid the import error (which is shown in the image)?

chemzqm commented 4 years ago

It's used for completion only, you have to configure your linter as well.