uwsgi importing and pylance/pylint

Viewed 49

If I use import uwsgi on my application I get an error on pylance, because uwsgi is only available on runtime (https://github.com/unbit/uwsgi/issues/1073).

Is there a way to make this module available to linters like pylance/pylint? for now I'm using # pylint: disable=import-error, but that does not silence pylance and it still does not offer any autocompletion.

1 Answers

pylint needs to be in the same virtualenv than your dependencies and be able to import them. Same for auto-completion, linters can't guess and needs to be able to access the library. So the solution would be to make uwsgi available in your dev environment (or at least the environment in which pylint is running).

Related