Pylance and mypy cannot find editable local imports

Posted on Thu 01 June 2023 in Pylance, Mypy, Python • Tagged with Pylance, Mypy, Python

The other day, I wrote a post about how I fixed a problem with Pylance not finding a local import. It worked, but now mypy was complaining about the same import.

The solution was installing the package in compat mode with:

pip install -e . --config-settings editable_mode=compat