python-lsp / pylsp-mypy

Mypy plugin for the Python LSP Server.
MIT License
118 stars 35 forks source link

typing Django problem(can't find Django stubs) #50

Closed jhartum closed 1 year ago

jhartum commented 1 year ago

I using pylsp with pylsp-mypy and Django-stubs in Neovim and I got error by mypy. I try it with null-ls and got the same problem and in null-ls I fix it by this way (link) but I wanna use pylsp with mypy.

Error

mypy: /Users/jhartum/Desktop/drums/drum-school/backend/pyproject.toml:1:1: error:
Error importing plugin "mypy_django_plugin.main": No module named
'mypy_django_plugin'  [misc]
    [tool.poetry]
    ^
Richardk2n commented 1 year ago

Can you show your pyproject.toml?

I have no experience with these tools, but a quick google search reveals, that you probably do not have the stubs installed in the venv in which you have mypy installed. Therefore, can you also provide an overview about your environments?