Improve pip package determination (#63321)
authorNikita Shulga <nshulga@fb.com>
Mon, 16 Aug 2021 20:50:44 +0000 (13:50 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 16 Aug 2021 20:54:39 +0000 (13:54 -0700)
commit3f06f295772e32197b55e7056704e9670f423fa1
tree407cdc86b28ed5313c64306a2275b8fce5b1b0e9
parent4a59f0b9d9354e0299e7041d2aa39c957fced69d
Improve pip package determination (#63321)

Summary:
Invoking `pip` or `pip3` yields list of packages invoked for `pip` alias on the path, rather than for the one currently being executed. Changed `get_pip_packages` to use `sys.executable + '-mpip'`

Also, add mypy to the list of packages of interest

Discovered while looking at https://github.com/pytorch/pytorch/issues/63279

Pull Request resolved: https://github.com/pytorch/pytorch/pull/63321

Reviewed By: walterddr

Differential Revision: D30342099

Pulled By: malfet

fbshipit-source-id: fc8d17cf2ddcf18236cfde5c1b9edb4e72804ee0
torch/utils/collect_env.py