Can't find stubgen
With Python 3.7.5 and mypy 0.660 on macOS 10.14.4, I'm unable to find the stubgen tool:
$ stubgen
bash: stubgen: command not found
$ python3 -m stubgen
/opt/homebrew/opt/python37/bin/python3.7: No module named stubgen
It's unclear from the documentation whether it's supposed to be globally available or if there are any other steps here.
Usually installing mypy via pip comes with a globally available stubgen command, as I verified on MacOS 10.15 with Python 3.7.5 and mypy 0.660. Would you please check your path again or be more specific about how you install mypy?
I should add mypy 0.660 is pretty old, almost a year old now (!), @devchakraborty you should probably update. If you can give how you installed mypy, and if other tools like flake8 work, then we may be better able to diagnose the issue.
stubgen or python3 -m mypy.stubgen should work. If you still can't get things working on with a newer version of mypy, feel free to reopen.
I'm trying to get python -m mypy.stubgen to work in my Jenkins build. It's hard for me to understand what's going on with this remote environment, but it is easier for me if I can specify the Python interpreter, as opposed to using the stubgen command directly.
When I run:
python3 -m pip install "mlflow>=1.23.1,!=1.30.0,<2" mypy==1.0.0 # for stubgen
python3 -m mypy.stubgen -p mlflow
I get:
python3: No code object available for mypy.stubgen
Edit: what finally worked:
python3 -m pip install "mlflow>=1.23.1,!=1.30.0,<2" mypy==1.0.0 # for stubgen
python3 -c "import mypy.stubgen; mypy.stubgen.main(['-p', 'mlflow'])"
I am seeing the same thing with a recent 1.13.0 conda install on MacOS M1, the suggested "-c import..." hack does work.