<#18519 bug with loading dependencies when running...
# github-notifications
c
#18519 bug with loading dependencies when running mypy Issue created by ryanking Pants version 2.16, but also was happening on 2.15 OS Mac I have been trying to hunt down a bug in pants for a few weeks and finally have a reproduction, but don't know what do do with it. From time to time, a mypy run will fail due to missing dependencies. Dependencies which are definitely configured and findable. Often a re-run will succeed, which has made this very hard to reproduce. I now found a case where running a single file will fail, but running with
::
will succeed. I have both sandboxes and when I edit __files.txt in the latter it passes. However I don't know what to look for in these sandboxes to figure out what's going on. Failure from the "bad" sandbox:
Copy code
.cache/pex_root/venvs/e1862d6434ffd1c4230c239d7d17d05591664247/4e8b276cfa3c3338d49f8656ee098b9ee6162291/lib/python3.8/site-packages/botocore-stubs/compat.pyi:20:1: error: Library stubs not installed for "six.moves.http_client"  [import]
    from six.moves import http_client
    ^
.cache/pex_root/venvs/e1862d6434ffd1c4230c239d7d17d05591664247/4e8b276cfa3c3338d49f8656ee098b9ee6162291/lib/python3.8/site-packages/botocore-stubs/compat.pyi:20:1: note: Hint: "python3 -m pip install types-six"
.cache/pex_root/venvs/e1862d6434ffd1c4230c239d7d17d05591664247/4e8b276cfa3c3338d49f8656ee098b9ee6162291/lib/python3.8/site-packages/botocore-stubs/compat.pyi:20:1: note: (or run "mypy --install-types" to install all missing stub packages)
.cache/pex_root/venvs/e1862d6434ffd1c4230c239d7d17d05591664247/4e8b276cfa3c3338d49f8656ee098b9ee6162291/lib/python3.8/site-packages/botocore-stubs/compat.pyi:20:1: note: See <https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports>
.cache/pex_root/venvs/e1862d6434ffd1c4230c239d7d17d05591664247/4e8b276cfa3c3338d49f8656ee098b9ee6162291/lib/python3.8/site-packages/botocore-stubs/compat.pyi:20:1: error: Library stubs not installed for "six.moves"  [import]
    from six.moves import http_client
    ^
src/django_apps/counseling/google_calendar.py:74:14: error: Module has no attribute "parser"  [attr-defined]
                (dateutil.parser.parse(e['start']), dateutil.parser.parse(e['end']))
                 ^~~~~~~~~~~~~~~
Found 3 errors in 2 files (checked 1 source file)
Success from the good sandbox, edited to run only the file in question:
Copy code
Success: no issues found in 1 source file
A fun complication is that the mypy cache appears to get poisoned. If I have a failed run on the "bad" sandbox, the good one will then fail. If I reset the cache it will work. pantsbuild/pants