I strugged with this for a while, so I assume someone else will as well. As is often the case with configuration issues, the solution turned out to be straightforward.
Relevant parts of my dev environment
CoC/Pylint reports “E0401” import errors on libraries that are correctly installed in a virtual environment.
CoC is using the wrong Python interpreter to run pylint. In my case, it was running the system installation, when I needed it to run the interpreter for my virtual environment.
Point CoC to the right interpreter using
and then selecting the one in my virtual environment.
Hope this helps!