admin管理员组

文章数量:1320661

I am working on a library package that depends on some other libraries and I statically type checking my code.

When running mypy (version 1.14.0) the first time on a freshly created enviroment, mypy finds the external libraries (for example peewee) and installs automatically the types-stubs from typeshed. But it does not install types-seaborn. So far this is the one and only exception to the rule.

If I install it manually with:

pip install types-seaborn

then mypy runs without any problem.

As a workaround I have explicitly added the types-seaborn dependency to the pyproject.toml file, but I would have preferred the automatic behavior.

Do you know why this is happening and how can I fix it?

I am working on a library package that depends on some other libraries and I statically type checking my code.

When running mypy (version 1.14.0) the first time on a freshly created enviroment, mypy finds the external libraries (for example peewee) and installs automatically the types-stubs from typeshed. But it does not install types-seaborn. So far this is the one and only exception to the rule.

If I install it manually with:

pip install types-seaborn

then mypy runs without any problem.

As a workaround I have explicitly added the types-seaborn dependency to the pyproject.toml file, but I would have preferred the automatic behavior.

Do you know why this is happening and how can I fix it?

Share Improve this question asked Jan 18 at 16:40 totototo 3624 silver badges13 bronze badges 7
  • Similar issue as stackoverflow/questions/60247157/… ? – rehaqds Commented Jan 18 at 17:26
  • it is indeed similar, but while for pandas and numpy, mypy is able to find the type stubs, for seaborn not. – toto Commented Jan 18 at 17:46
  • What is your python version? – rehaqds Commented Jan 18 at 18:09
  • Python 3.12, mypy 1.14.0, both in Linux and Windows – toto Commented Jan 18 at 19:24
  • what error or warning do you get from mypy when you use seaborn? – rehaqds Commented Jan 18 at 20:33
 |  Show 2 more comments

1 Answer 1

Reset to default 2

This was a bug in mypy, reported by OP in #18485 and fixed on master a bit earlier in #18366. Last affected version is 1.14.1, this should work as expected with the next release (or use pip install git+https://github/python/mypy now to use the master version).

本文标签: pythonmypy does not install typesseaborn automaticallyStack Overflow