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.
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).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.