Bug Report
When using --python-executable with globally installed mypy, it discovers the packages installed in the virtualenv, but not the installed plugins
To Reproduce
- Use globally installed mypy
python -m venv .venv
.venv/bin/pip install pydantic
echo pass > main.py
- In
pyproject.toml:
[tool.mypy]
plugins = ["pydantic.mypy"]
mypy --python-executable .venv/bin/python main.py
Expected Behavior
It should pass with no errors, just like it does when installed inside of the virtualenv
Actual Behavior
pyproject.toml:1: error: Error importing plugin "pydantic.mypy": No module named 'pydantic' [misc]
Found 1 error in 1 file (errors prevented further checking)
Your Environment
- Mypy version used: 2.1.0
- Python version used: 3.14.6
Bug Report
When using
--python-executablewith globally installed mypy, it discovers the packages installed in the virtualenv, but not the installed pluginsTo Reproduce
python -m venv .venv.venv/bin/pip install pydanticecho pass > main.pypyproject.toml:mypy --python-executable .venv/bin/python main.pyExpected Behavior
It should pass with no errors, just like it does when installed inside of the virtualenv
Actual Behavior
Your Environment