# Installing Tensorflow and object detection errors -\*\*ImportError: cannot import name 'builder' from 'google.protobuf.internal'

**URL:** <https://discuss.ai.google.dev/t/installing-tensorflow-and-object-detection-errors-importerror-cannot-import-name-builder-from-google-protobuf-internal/28146>\
**Category:** General Discussion\
**Tags:** tf-install, object-detection\
**Created:** [April 5, 2024, 11:22am UTC](https://discuss.ai.google.dev/t/installing-tensorflow-and-object-detection-errors-importerror-cannot-import-name-builder-from-google-protobuf-internal/28146 "2024-04-05T11:22:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alistair\_Phillips](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/alistair_phillips/32/7146_2.png) [@Alistair\_Phillips](https://discuss.ai.google.dev/u/Alistair_Phillips)\
**Post date:** [April 5, 2024, 11:22am UTC](https://discuss.ai.google.dev/t/installing-tensorflow-and-object-detection-errors-importerror-cannot-import-name-builder-from-google-protobuf-internal/28146/1 "2024-04-05T11:22:38Z")

</div>

Full disclosure, python etc is not my strong point i’m learning and following tutorials, however the ease at which all of these fail is frustrating. I am following the tutorials and then something breaks or doesnt work and then spend hours trying to fix it only for something else to break !

I am following the tutorial here: [Installation — TensorFlow 2 Object Detection API tutorial documentation](https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html#anaconda-python-3-8-optional)

Ill list my commands step by step in the hope some one can tell me what im doing wrong

conda create -n tensorflow pip python=3.9

conda activate tensorflow

pip install --ignore-installed --upgrade tensorflow==2.5.0

python -c “import tensorflow as tf;print(tf.reduce\_sum(tf.random.normal([1000, 1000])))”

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

(no output is shown or errors)

pip install cython

pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

cp object\_detection/packages/tf2/setup.py .

python -m pip install .

python object\_detection/builders/model\_builder\_tf2\_test.py

**Traceback (most recent call last):**

**File “C:\tensorflow\models\research\object\_detection\builders\model\_builder\_tf2\_test.py”, line 24, in**

**from object\_detection.builders import model\_builder**

**File “C:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\object\_detection\builders\model\_builder.py”, line 23, in**

**from object\_detection.builders import anchor\_generator\_builder**

**File “C:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\object\_detection\builders\anchor\_generator\_builder.py”, line 26, in**

**from object\_detection.protos import anchor\_generator\_pb2**

**File “C:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\object\_detection\protos\anchor\_generator\_pb2.py”, line 5, in**

**from google.protobuf.internal import builder as \_builder**

**ImportError: cannot import name ‘builder’ from ‘google.protobuf.internal’ (C:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\google\protobuf\internal\__init_\_.py)**

---

<div class="post-metadata">

**Author:** ![Kiran\_Sai\_Ramineni](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/kiran_sai_ramineni/32/8859_2.png) [@Kiran\_Sai\_Ramineni](https://discuss.ai.google.dev/u/Kiran_Sai_Ramineni)\
**Post date:** [April 16, 2024, 8:21am UTC](https://discuss.ai.google.dev/t/installing-tensorflow-and-object-detection-errors-importerror-cannot-import-name-builder-from-google-protobuf-internal/28146/3 "2024-04-16T08:21:30Z")

</div>

Hi @Alistair_Phillips, I have run the above commands in wsl environment with Tensorflow 2.15 and did not face any error.

 ![image (2)](https://d3qe71uytubmmx.cloudfront.net/original/3X/0/d/0d8f5e6e2e48553f4cd6a4ca5a0da1415e0d8244.png)

Thank You.

---

<div class="post-metadata">

**Author:** ![abdullahsuheyl](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/abdullahsuheyl/32/15701_2.png) [@abdullahsuheyl](https://discuss.ai.google.dev/u/abdullahsuheyl)\
**Post date:** [April 18, 2024, 8:53am UTC](https://discuss.ai.google.dev/t/installing-tensorflow-and-object-detection-errors-importerror-cannot-import-name-builder-from-google-protobuf-internal/28146/5 "2024-04-18T08:53:02Z")

</div>

Could it be working because you’re using Linux? Because it doesn’t work properly on windows @Kiran_Sai_Ramineni
