You’re running into a common issue in Python type checking, especially when using tools like mypy or similar static analyzers. The error:
Skipping analyzing “yfinance”: module is installed, but missing library stubs or py.typed marker
Try these ways to see if it's fixed or not
Since yfinance doesn’t provide type hints, you can tell mypy to ignore it by adding this in your code:
python
from typing import Any
import yfinance # type: ignore
data: Any = yfinance.download("AAPL")
Or, globally ignore the warning in mypy.ini:
ini
[mypy]
ignore_missing_imports = True
Some libraries have third-party stubs available. Try installing:
sh
pip install types-requests types-pytz
If yfinance had a stub package (it currently doesn’t), it would be named types-yfinance.
Ensure your environment is set up correctly:
sh
python -m venv venv
venv\Scripts\activate # On Windows
source venv/bin/activate # On MacOS
pip install yfinance mypy
If you’re working on your own package and want it to be recognized as typed, create an empty py.typed file inside your module’s directory:
sh
touch mymodule/py.typed