--python-executable doesn't discover plugins
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
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 pydanticecho 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the documented reproduction with main.py, pyproject.toml, and --python-executable .venv/bin/python. Trace how mypy resolves plugins versus packages from the selected interpreter; done means pydantic.mypy loads successfully and the command completes without errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100