Title: Mypy cannot find library stubs for protobuf · Issue #10986 · python/typeshed · GitHub
Open Graph Title: Mypy cannot find library stubs for protobuf · Issue #10986 · python/typeshed
X Title: Mypy cannot find library stubs for protobuf · Issue #10986 · python/typeshed
Description: I'm having issues with mypy correctly finding type stubs. After creating a virtual environment on my Fedora machine using virtualenv, I install the following packages: pip install mypy protobuf types-protobuf Using mypy to check the foll...
Open Graph Description: I'm having issues with mypy correctly finding type stubs. After creating a virtual environment on my Fedora machine using virtualenv, I install the following packages: pip install mypy protobuf typ...
X Description: I'm having issues with mypy correctly finding type stubs. After creating a virtual environment on my Fedora machine using virtualenv, I install the following packages: pip install mypy protobuf...
Opengraph URL: https://github.com/python/typeshed/issues/10986
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mypy cannot find library stubs for protobuf","articleBody":"I'm having issues with mypy correctly finding type stubs.\r\n\r\nAfter creating a virtual environment on my Fedora machine using `virtualenv`, I install the following packages:\r\n\r\n```sh\r\npip install mypy protobuf types-protobuf\r\n```\r\n\r\nUsing mypy to check the following code\r\n\r\n```python\r\nimport google.protobuf\r\n```\r\n\r\nI get the error messsage:\r\n\r\n```\r\nmy_file.py:1: error: Skipping analyzing \"google\": module is installed, but missing library stubs or py.typed marker [import-untyped]\r\nmy_file.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports\r\nFound 1 error in 1 file (checked 1 source file)\r\n```\r\n\r\nThe reason for this seems that in the virtual environment there are two independent lib directories (`my_env/lib` and `my_env/lib64`). One `google` directory containing code of the protobuf package is in `lib64/google` and the types (`types-protobuf`) are installed to `lib/google-stubs`.\r\nEither moving the `google-stubs` directory to the `lib64` variant or creating an (empty) `google` directory in `lib` resolves the issue.\r\n\r\nIt seems mypy is unable to find the corresponding type stubs in the respectively other lib directory.\r\n\r\nHas anybody an idea on how to approach this? I do not even know whether the respective installation locations of either the protobuf or the types-protobuf package are correct or whether this is an issue with mypy resolving types?!","author":{"url":"https://github.com/schmidma","@type":"Person","name":"schmidma"},"datePublished":"2023-11-06T16:09:45Z","url":"https://github.com/python/typeshed/issues/10986"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2bee8ed5-154a-ed58-a925-0fc5de7b552b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B6C6:3E987B:E362E5:131E4D4:6B0059EB |
| html-safe-nonce | 3343ded1a91865295abd2a4fc712f64c9c1084f1061d6a3913ddaca2770385c2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkM2OjNFOTg3QjpFMzYyRTU6MTMxRTRENDo2QjAwNTlFQiIsInZpc2l0b3JfaWQiOiI1NjE1MTA3NTM0MzkxMTA2MDI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7b336634d5c976e49cd4196feb4a7c3aabb09c8b3931e6ec0fb83dc0e56e8e9e |
| hovercard-subject-tag | issue:1979522837 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typeshed/10986/issue_layout |
| twitter:image | https://opengraph.githubassets.com/58d3d9b4a0d90c6008042b85b5c940bce9492dd53a829aa55bb22ac22c343b16/python/typeshed/issues/10986 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/58d3d9b4a0d90c6008042b85b5c940bce9492dd53a829aa55bb22ac22c343b16/python/typeshed/issues/10986 |
| og:image:alt | I'm having issues with mypy correctly finding type stubs. After creating a virtual environment on my Fedora machine using virtualenv, I install the following packages: pip install mypy protobuf typ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | schmidma |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width