stacklok/feedback

VSCode Extension: Python import parsing ignores requirements.txt / import tooling

Opened this issue · 0 comments

Python library import foo statements don't always line up with the package name on pypi. This is probably partially historical accident (libraries existed before PyPI, and PyPI didn't enforce a mapping between package names and how they are imported). This shows up with a number of modules, for example, the elasticsearch7 package, which installs as import elasticsearch. (This example is benign, but was easy to find.)

I think the proper fix requires understanding requirements.txt and the python library imports -- maybe from the PyLance python language server?