# ImportError: cannot import name 'runtime\_version' from 'google.protobuf'

**URL:** <https://discuss.ai.google.dev/t/importerror-cannot-import-name-runtime-version-from-google-protobuf/22770>\
**Category:** General Discussion\
**Tags:** object-detection, tensorflow\
**Created:** [May 31, 2024, 5:22am UTC](https://discuss.ai.google.dev/t/importerror-cannot-import-name-runtime-version-from-google-protobuf/22770 "2024-05-31T05:22:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suvodeep\_Roy](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/suvodeep_roy/32/9651_2.png) [@Suvodeep\_Roy](https://discuss.ai.google.dev/u/Suvodeep_Roy)\
**Post date:** [May 31, 2024, 5:22am UTC](https://discuss.ai.google.dev/t/importerror-cannot-import-name-runtime-version-from-google-protobuf/22770/1 "2024-05-31T05:22:31Z")

</div>

when i am setting for tensorflow object detection API, while i am running this instruction for testing setup  
object\_detection/builders/model\_builder\_tf2\_test.py

i am getting this error-  
ImportError: cannot import name ‘runtime\_version’ from ‘google.protobuf’ (C:\Anaconda3\envs\tfod\lib\site-packages\google\protobuf\__init_\_.py)

Drar friends please help how to solve this

---

<div class="post-metadata">

**Author:** ![Unknown](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/unknown/32/13957_2.png) [@Unknown](https://discuss.ai.google.dev/u/Unknown)\
**Post date:** [June 5, 2024, 1:53pm UTC](https://discuss.ai.google.dev/t/importerror-cannot-import-name-runtime-version-from-google-protobuf/22770/3 "2024-06-05T13:53:46Z")

</div>

If you are using the lastest version of protobuf, try installing an earlier version of protobuf.

For my object detection project version 3.12.3 is working fine.

You can get it here: [Releases · protocolbuffers/protobuf · GitHub](https://github.com/protocolbuffers/protobuf/releases?page=11)

---

<div class="post-metadata">

**Author:** ![RayAp23](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/rayap23/32/30711_2.png) [@RayAp23](https://discuss.ai.google.dev/u/RayAp23)\
**Post date:** [November 27, 2024, 2:46am UTC](https://discuss.ai.google.dev/t/importerror-cannot-import-name-runtime-version-from-google-protobuf/22770/5 "2024-11-27T02:46:16Z")

</div>

Hi all,

I am facing the same issue. I am running on a win 11 machine.

I am following the instructions on  
[https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html](https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html)

However, when I run the test script  
python object\_detection/builders/model\_builder\_tf2\_test.py

I got the following error:

ImportError: cannot import name ‘runtime\_version’ from ‘google.protobuf’

my current configuration:

pip show protobuf

Name: protobuf  
Version: 3.19.6

I downloaded protoc-3.12.3-win64 and copied the bin and include folders into my C:\Program Files\Google Protobuf

my environment path contains C:\Program Files\Google Protobuf\bin

when I ran

protoc object\_detection/protos/\*.proto --python\_out=.

I did not get any error.

Do let me know what else I need to do to get the system running.
