René's URL Explorer Experiment


Title: Caching bug with `--incremental --cache-dir` combination causes `AssertionError: Cannot find module` · Issue #16214 · python/mypy · GitHub

Open Graph Title: Caching bug with `--incremental --cache-dir` combination causes `AssertionError: Cannot find module` · Issue #16214 · python/mypy

X Title: Caching bug with `--incremental --cache-dir` combination causes `AssertionError: Cannot find module` · Issue #16214 · python/mypy

Description: Crash Report There appears to be a caching bug in mypy 1.2.0 (compiled: yes). This started occurring recently after we upgraded from 1.0.0 to 1.2.0. I am running mypy with these parameters: mypy --config ./mypy.ini --incremental --cache-...

Open Graph Description: Crash Report There appears to be a caching bug in mypy 1.2.0 (compiled: yes). This started occurring recently after we upgraded from 1.0.0 to 1.2.0. I am running mypy with these parameters: mypy --...

X Description: Crash Report There appears to be a caching bug in mypy 1.2.0 (compiled: yes). This started occurring recently after we upgraded from 1.0.0 to 1.2.0. I am running mypy with these parameters: mypy --...

Opengraph URL: https://github.com/python/mypy/issues/16214

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Caching bug with `--incremental --cache-dir` combination causes `AssertionError: Cannot find module`","articleBody":"**Crash Report**\r\n\r\nThere appears to be a caching bug in `mypy 1.2.0 (compiled: yes)`.\r\n\r\nThis started occurring recently after we upgraded from `1.0.0` to `1.2.0`.\r\n\r\nI am running mypy with these parameters:\r\n```\r\nmypy --config ./mypy.ini --incremental --cache-dir ./.local/mypy_cache/app --no-install-types --follow-imports=skip ./app\r\n```\r\n\r\nand very frequently getting the error:\r\n```\r\nAssertionError: Cannot find module for google\r\n```\r\n(There is no package in our application called simply `google`; but there are a bunch that start with that name, and have import paths starting with `google.`; see below.)\r\n\r\nIf I delete the contents of `.local/mypy_cache`, then the error goes away momentarily, but quickly comes back on the next run.\r\n\r\nFor example:\r\n1. I'm on `branch_a`, I run the `mypy` invocation above, and get that error.\r\n2. `rm -rf .local/mypy_cache`\r\n3. Run `mypy` again, it passes without error (`Success: no issues found in N source files`).\r\n4. Switch to `branch_b`, run `mypy` again – errors again.\r\n5. Repeat steps 2 and 3 – no errors.\r\n6. Switch back to `branch_a`, errors again, etc.\r\n\r\n**Traceback**\r\n(file paths user `/Users/*` modified from original)\r\n```\r\nTraceback (most recent call last):\r\n  File \"/Users/myname/.pyenv/versions/my-venv-path/bin/mypy\", line 8, in \u003cmodule>\r\n    sys.exit(console_entry())\r\n  File \"/Users/myname/.pyenv/versions/3.10.11/envs/my-venv-path/lib/python3.10/site-packages/mypy/__main__.py\", line 15, in console_entry\r\n    main()\r\n  File \"mypy/main.py\", line 95, in main\r\n  File \"mypy/main.py\", line 174, in run_build\r\n  File \"mypy/build.py\", line 194, in build\r\n  File \"mypy/build.py\", line 277, in _build\r\n  File \"mypy/build.py\", line 2930, in dispatch\r\n  File \"mypy/build.py\", line 3321, in process_graph\r\n  File \"mypy/build.py\", line 3402, in process_fresh_modules\r\n  File \"mypy/build.py\", line 2121, in fix_cross_refs\r\n  File \"mypy/fixup.py\", line 53, in fixup_module\r\n  File \"mypy/fixup.py\", line 122, in visit_symbol_table\r\n  File \"mypy/lookup.py\", line 31, in lookup_fully_qualified\r\nAssertionError: Cannot find module for google\r\n```\r\n\r\n**Your Environment**\r\n\r\n- Python 3.10.11\r\n- mypy 1.2.0 (compiled: yes)\r\n- OS: MacOS Ventura 13.5.2\r\n\r\n(see `mypy` parameters used above)\r\n\r\nGiven the error about `google`, this is the output of `pip freeze | grep google`:\r\n```\r\napache-airflow-providers-google==10.7.0\r\ngoogle-ads==21.3.0\r\ngoogle-api-core==2.11.1\r\ngoogle-api-python-client==2.97.0\r\ngoogle-auth==2.22.0\r\ngoogle-auth-httplib2==0.1.0\r\ngoogle-auth-oauthlib==1.0.0\r\ngoogle-cloud-aiplatform==1.31.1\r\ngoogle-cloud-appengine-logging==1.3.1\r\ngoogle-cloud-audit-log==0.2.5\r\ngoogle-cloud-automl==2.11.2\r\ngoogle-cloud-batch==0.16.0\r\ngoogle-cloud-bigquery==3.11.4\r\ngoogle-cloud-bigquery-datatransfer==3.12.0\r\ngoogle-cloud-bigquery-storage==2.22.0\r\ngoogle-cloud-bigtable==2.21.0\r\ngoogle-cloud-build==3.20.0\r\ngoogle-cloud-compute==1.14.0\r\ngoogle-cloud-container==2.30.0\r\ngoogle-cloud-core==2.3.3\r\ngoogle-cloud-datacatalog==3.15.0\r\ngoogle-cloud-dataflow-client==0.8.4\r\ngoogle-cloud-dataform==0.5.2\r\ngoogle-cloud-dataplex==1.6.2\r\ngoogle-cloud-dataproc==5.4.3\r\ngoogle-cloud-dataproc-metastore==1.12.0\r\ngoogle-cloud-dlp==3.12.2\r\ngoogle-cloud-kms==2.19.1\r\ngoogle-cloud-language==2.11.0\r\ngoogle-cloud-logging==3.6.0\r\ngoogle-cloud-memcache==1.7.2\r\ngoogle-cloud-monitoring==2.15.1\r\ngoogle-cloud-orchestration-airflow==1.9.1\r\ngoogle-cloud-os-login==2.10.0\r\ngoogle-cloud-pubsub==2.18.3\r\ngoogle-cloud-redis==2.13.1\r\ngoogle-cloud-resource-manager==1.10.3\r\ngoogle-cloud-run==0.9.1\r\ngoogle-cloud-secret-manager==2.16.3\r\ngoogle-cloud-spanner==3.40.1\r\ngoogle-cloud-speech==2.21.0\r\ngoogle-cloud-storage==2.10.0\r\ngoogle-cloud-storage-transfer==1.9.1\r\ngoogle-cloud-tasks==2.14.1\r\ngoogle-cloud-texttospeech==2.14.1\r\ngoogle-cloud-translate==3.12.0\r\ngoogle-cloud-videointelligence==2.11.3\r\ngoogle-cloud-vision==3.4.4\r\ngoogle-cloud-workflows==1.11.0\r\ngoogle-crc32c==1.5.0\r\ngoogle-re2==1.1\r\ngoogle-resumable-media==2.5.0\r\ngoogleapis-common-protos==1.60.0\r\ngrpc-google-iam-v1==0.12.6\r\npydata-google-auth==1.8.2\r\n```\r\n\r\nThank you!","author":{"url":"https://github.com/benbuckman","@type":"Person","name":"benbuckman"},"datePublished":"2023-10-02T03:58:41Z","url":"https://github.com/python/mypy/issues/16214"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:38ab1066-13d7-b420-153d-70ba8e9192a7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE370:27AD12:3F42A9:551C19:6B002B95
html-safe-nonce92cfd4509e8ca742433b9039b7e85f1667e23d54661597fc8bcc669a3545d28f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzcwOjI3QUQxMjozRjQyQTk6NTUxQzE5OjZCMDAyQjk1IiwidmlzaXRvcl9pZCI6IjU1Mjk0NTQ1NjQ5NzUwNjE5MDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9579fdd20187b6ad5ea915784feec6a1e4d5921c93cd1cc6077b0617095b6eb3
hovercard-subject-tagissue:1921206094
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/16214/issue_layout
twitter:imagehttps://opengraph.githubassets.com/63c9bf405863ff0a16be1258111c5b6b11e11ec907438953c55e0eb3bc1ce0a6/python/mypy/issues/16214
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/63c9bf405863ff0a16be1258111c5b6b11e11ec907438953c55e0eb3bc1ce0a6/python/mypy/issues/16214
og:image:altCrash Report There appears to be a caching bug in mypy 1.2.0 (compiled: yes). This started occurring recently after we upgraded from 1.0.0 to 1.2.0. I am running mypy with these parameters: mypy --...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebenbuckman
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
turbo-cache-controlno-preview
go-importgithub.com/python/mypy git https://github.com/python/mypy.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id7053637
octolytics-dimension-repository_nwopython/mypy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7053637
octolytics-dimension-repository_network_root_nwopython/mypy
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/16214#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F16214
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F16214
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fmypy
Reloadhttps://github.com/python/mypy/issues/16214
Reloadhttps://github.com/python/mypy/issues/16214
Reloadhttps://github.com/python/mypy/issues/16214
pythonhttps://github.com/python
mypyhttps://github.com/python/mypy
Codehttps://github.com/python/mypy
Issues2.7k (2.7k)https://github.com/python/mypy/issues
Pull requests547 (547)https://github.com/python/mypy/pulls
Actionshttps://github.com/python/mypy/actions
Projectshttps://github.com/python/mypy/projects
Wikihttps://github.com/python/mypy/wiki
Security and qualityhttps://github.com/python/mypy/security
Insightshttps://github.com/python/mypy/insights
https://github.com/python/mypy
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/16214
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/16214
#20742https://github.com/python/mypy/pull/20742
Caching bug with --incremental --cache-dir combination causes AssertionError: Cannot find modulehttps://github.com/python/mypy/issues/16214#top
#20742https://github.com/python/mypy/pull/20742
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-incrementalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-incremental%22
https://github.com/benbuckman
benbuckmanhttps://github.com/benbuckman
on Oct 2, 2023https://github.com/python/mypy/issues/16214#issue-1921206094
benbuckmanhttps://github.com/benbuckman
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
on Oct 2, 2023https://github.com/python/mypy/issues/16214#event-10521701384
AlexWaygoodhttps://github.com/AlexWaygood
topic-incrementalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-incremental%22
on Oct 3, 2023https://github.com/python/mypy/issues/16214#event-10533454619
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Oct 3, 2023https://github.com/python/mypy/issues/16214#issuecomment-1744252284
https://github.com/aman-wisdom
aman-wisdomhttps://github.com/aman-wisdom
on Feb 23, 2024https://github.com/python/mypy/issues/16214#issuecomment-1962060810
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Jun 22, 2024https://github.com/python/mypy/issues/16214#issuecomment-2183944051
https://github.com/adzenith
adzenithhttps://github.com/adzenith
on Sep 17, 2024https://github.com/python/mypy/issues/16214#issuecomment-2355658894
https://github.com/adzenith
adzenithhttps://github.com/adzenith
on Sep 17, 2024https://github.com/python/mypy/issues/16214#issuecomment-2355750505
https://github.com/david-melville
david-melvillehttps://github.com/david-melville
on Dec 3, 2024https://github.com/python/mypy/issues/16214#issuecomment-2513408552
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Sep 6, 2025https://github.com/python/mypy/issues/16214#issuecomment-3260123146
https://github.com/Tansito
Tansitohttps://github.com/Tansito
on Dec 1, 2025https://github.com/python/mypy/issues/16214#issuecomment-3598767339
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Dec 1, 2025https://github.com/python/mypy/issues/16214#issuecomment-3598778117
@Tansitohttps://github.com/Tansito
https://github.com/Tansito
Tansitohttps://github.com/Tansito
on Dec 1, 2025https://github.com/python/mypy/issues/16214#issuecomment-3598839605
@ilevkivskyihttps://github.com/ilevkivskyi
Qiskit/qiskit-serverless#1787https://github.com/Qiskit/qiskit-serverless/pull/1787
RiyaPrabhakar-githttps://github.com/RiyaPrabhakar-git
GC-Content-Calculatorhttps://github.com/users/RiyaPrabhakar-git/projects/1
on Dec 12, 2025https://github.com/python/mypy/issues/16214#event-21527464520
github-project-automationhttps://github.com/apps/github-project-automation
GC-Content-Calculatorhttps://github.com/users/RiyaPrabhakar-git/projects/1
on Dec 12, 2025https://github.com/python/mypy/issues/16214
https://github.com/cburroughs
cburroughshttps://github.com/cburroughs
on Jan 21, 2026https://github.com/python/mypy/issues/16214#issuecomment-3781220108
mypy/mypy/build.pyhttps://github.com/python/mypy/blob/639fcde32cd75860e3c369ad1b23bd405a01911a/mypy/build.py#L2364
639fcdehttps://github.com/python/mypy/commit/639fcde32cd75860e3c369ad1b23bd405a01911a
mypy/mypy/fixup.pyhttps://github.com/python/mypy/blob/61b3b5dd5f8d5e80c980d76c38e092f7020ed656/mypy/fixup.py#L51
61b3b5dhttps://github.com/python/mypy/commit/61b3b5dd5f8d5e80c980d76c38e092f7020ed656
#10260https://github.com/python/mypy/issues/10260
#19477https://github.com/python/mypy/issues/19477
#18751https://github.com/python/mypy/issues/18751
https://github.com/cburroughs
cburroughshttps://github.com/cburroughs
on Jan 23, 2026https://github.com/python/mypy/issues/16214#issuecomment-3791655355
cburroughshttps://github.com/cburroughs
on Jan 27, 2026https://github.com/python/mypy/issues/16214#event-22330361364
fix crash resolving cross-refs to suppressed moduleshttps://github.com/cburroughs/mypy/commit/052fbd7ffcb8625e3fda7b8021d216808da7d73e
https://docs.github.com/articles/closing-issues-via-commit-messages
052fbd7https://github.com/cburroughs/mypy/commit/052fbd7ffcb8625e3fda7b8021d216808da7d73e
ilevkivskyihttps://github.com/ilevkivskyi
on Feb 6, 2026https://github.com/python/mypy/issues/16214#event-22590549650
Fix crash on partially typed namespace package (#20742)https://github.com/python/mypy/commit/1d18566919ab18ea53e38283bf9516fe2e33548f
#20742https://github.com/python/mypy/pull/20742
1d18566https://github.com/python/mypy/commit/1d18566919ab18ea53e38283bf9516fe2e33548f
ilevkivskyihttps://github.com/ilevkivskyi
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#20742https://github.com/python/mypy/pull/20742
on Feb 6, 2026https://github.com/python/mypy/issues/16214#event-22590549655
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/16214
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/16214
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-incrementalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-incremental%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.