# Failed to import wandb after updating to wandb 0.16.6

**URL:** <https://community.wandb.ai/t/failed-to-import-wandb-after-updating-to-wandb-0-16-6/6361>\
**Category:** W&B Help\
**Tags:** wandb\
**Created:** [April 10, 2024, 8:52am UTC](https://community.wandb.ai/t/failed-to-import-wandb-after-updating-to-wandb-0-16-6/6361 "2024-04-10T08:52:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ching-yi](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@ching-yi](https://community.wandb.ai/u/ching-yi)\
**Post date:** [April 10, 2024, 8:52am UTC](https://community.wandb.ai/t/failed-to-import-wandb-after-updating-to-wandb-0-16-6/6361/1 "2024-04-10T08:52:18Z")

</div>

Hello, I can’t do `import wandb` and got following error after upgrading to wandb 0.16.6. My first guess is incompatibility of `protobuf`, but don’t know how to fix. My python version is 3.11. Please help, thank you.

```auto
Traceback (most recent call last):
  File "/app/cli.py", line 10, in <module>
    import wandb
  File "/venv/lib/python3.11/site-packages/wandb/ __init__.py", line 27, in <module>
    from wandb import sdk as wandb_sdk
  File "/venv/lib/python3.11/site-packages/wandb/sdk/ __init__.py", line 25, in <module>
    from .artifacts.artifact import Artifact
  File "/venv/lib/python3.11/site-packages/wandb/sdk/artifacts/artifact.py", line 46, in <module>
    from wandb.apis.normalize import normalize_exceptions
  File "/venv/lib/python3.11/site-packages/wandb/apis/ __init__.py", line 43, in <module>
    from .internal import Api as InternalApi # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/wandb/apis/internal.py", line 3, in <module>
    from wandb.sdk.internal.internal_api import Api as InternalApi
  File "/venv/lib/python3.11/site-packages/wandb/sdk/internal/internal_api.py", line 48, in <module>
    from ..lib import retry
  File "/venv/lib/python3.11/site-packages/wandb/sdk/lib/retry.py", line 17, in <module>
    from .mailbox import ContextCancelledError
  File "/venv/lib/python3.11/site-packages/wandb/sdk/lib/mailbox.py", line 102, in <module>
    class _MailboxSlot:
  File "/venv/lib/python3.11/site-packages/wandb/sdk/lib/mailbox.py", line 103, in _MailboxSlot
    _result: Optional[pb.Result]
                      ^^^^^^^^^
AttributeError: module 'wandb.proto.wandb_internal_pb2' has no attribute 'Result'
(.venv) ching-yi@Ching-Yis-MacBook-Pro morphio % docker compose run --rm main python cli.py eval --help
Traceback (most recent call last):
  File "/app/cli.py", line 10, in <module>
    import wandb
  File "/venv/lib/python3.11/site-packages/wandb/ __init__.py", line 27, in <module>
    from wandb import sdk as wandb_sdk
  File "/venv/lib/python3.11/site-packages/wandb/sdk/ __init__.py", line 25, in <module>
    from .artifacts.artifact import Artifact
  File "/venv/lib/python3.11/site-packages/wandb/sdk/artifacts/artifact.py", line 46, in <module>
    from wandb.apis.normalize import normalize_exceptions
  File "/venv/lib/python3.11/site-packages/wandb/apis/ __init__.py", line 43, in <module>
    from .internal import Api as InternalApi # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/wandb/apis/internal.py", line 3, in <module>
    from wandb.sdk.internal.internal_api import Api as InternalApi
  File "/venv/lib/python3.11/site-packages/wandb/sdk/internal/internal_api.py", line 48, in <module>
    from ..lib import retry
  File "/venv/lib/python3.11/site-packages/wandb/sdk/lib/retry.py", line 17, in <module>
    from .mailbox import ContextCancelledError
  File "/venv/lib/python3.11/site-packages/wandb/sdk/lib/mailbox.py", line 102, in <module>
    class _MailboxSlot:
  File "/venv/lib/python3.11/site-packages/wandb/sdk/lib/mailbox.py", line 103, in _MailboxSlot
    _result: Optional[pb.Result]
                      ^^^^^^^^^
AttributeError: module 'wandb.proto.wandb_internal_pb2' has no attribute 'Result'

```

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [April 10, 2024, 3:38pm UTC](https://community.wandb.ai/t/failed-to-import-wandb-after-updating-to-wandb-0-16-6/6361/2 "2024-04-10T15:38:58Z")

</div>

Thank you so much for writing in, and apologies you are seeing this behavior.

`AttributeError: module 'wandb.proto.wandb_internal_pb2' has no attribute 'Result'"` - this error does seem to be coming from the protobuf version. Would you be able to try to downgrade your protobuf package to 3.20.x or lower?

---

<div class="post-metadata">

**Author:** ![ching-yi](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@ching-yi](https://community.wandb.ai/u/ching-yi)\
**Post date:** [April 10, 2024, 6:05pm UTC](https://community.wandb.ai/t/failed-to-import-wandb-after-updating-to-wandb-0-16-6/6361/3 "2024-04-10T18:05:21Z")

</div>

Thank you for the reply! I’m using protobuf==4.25.3, which is automatically pinned by wandb. I used `pip-compile --generate-hashes --no-emit-index-url --strip-extras requirements.dev.in`, and that generated `requirements.dev.text` exactly:

```auto
...
protobuf==4.25.3 \
    --hash=sha256:19b270aeaa0099f16d3ca02628546b8baefe2955bbe23224aaf856134eccf1e4 \
    --hash=sha256:209ba4cc916bab46f64e56b85b090607a676f66b473e6b762e6f1d9d591eb2e8 \
    --hash=sha256:25b5d0b42fd000320bd7830b349e3b696435f3b329810427a6bcce6a5492cc5c \
    --hash=sha256:7c8daa26095f82482307bc717364e7c13f4f1c99659be82890dcfc215194554d \
    --hash=sha256:c053062984e61144385022e53678fbded7aea14ebb3e0305ae3592fb219ccfa4 \
    --hash=sha256:d4198877797a83cbfe9bffa3803602bbe1625dc30d8a097365dbc762e5790faa \
    --hash=sha256:e3c97a1555fd6388f857770ff8b9703083de6bf1f9274a002a332d65fbb56c8c \
    --hash=sha256:e7cb0ae90dd83727f0c0718634ed56837bfeeee29a5f82a7514c03ee1364c019 \
    --hash=sha256:f0700d54bcf45424477e46a9f0944155b46fb0639d69728739c0e47bab83f2b9 \
    --hash=sha256:f1279ab38ecbfae7e456a108c5c0681e4956d5b1090027c1de0f934dfdb4b35c \
    --hash=sha256:f4f118245c4a087776e0a8408be33cf09f6c547442c00395fbfb116fac2f8ac2
    # via wandb
...

```

from `requirements.dev.in`:

```auto
-c requirements.txt
black>=24.3.0
cfn-lint>=0.86.2
cfn-lint-ax>=0.0.13
cfn-lint-serverless>=0.3.2
docker>=7.0.0
flake8>=7.0.0
httpx>=0.27.0
mypy>=1.9.0
iac-container>=2023.8.17
isort>=5.13.2
pandas>=2.2.1
pytest>=8.1.1
troposphere>=4.7.0
wandb>=0.16.6
yamllint>=1.35.1

```

I didn’t have this problem before, so it is super confusing now…

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [April 12, 2024, 6:05pm UTC](https://community.wandb.ai/t/failed-to-import-wandb-after-updating-to-wandb-0-16-6/6361/4 "2024-04-12T18:05:05Z")

</div>

Thank you for sending it over!

Could you try running `pip install protobuf==3.20.1` and see if that changes anything for you?

Could you also see if downgrading back to 0.16.5 resolves this concern for you, and its definitely something to do with 0.16.6?

---

<div class="post-metadata">

**Author:** ![ching-yi](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@ching-yi](https://community.wandb.ai/u/ching-yi)\
**Post date:** [April 15, 2024, 3:40am UTC](https://community.wandb.ai/t/failed-to-import-wandb-after-updating-to-wandb-0-16-6/6361/5 "2024-04-15T03:40:29Z")

</div>

Do you mean `protobuf==3.20.1` and `wandb==0.16.5` simultaneously? I have tried `wandb==0.16.5` and the error still exists. The version of `protobuf` is pinned by `wandb`, so I am unsure how to set `protobuf==3.20.1` for `wandb==0.16.5` manually …

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [April 15, 2024, 3:30pm UTC](https://community.wandb.ai/t/failed-to-import-wandb-after-updating-to-wandb-0-16-6/6361/6 "2024-04-15T15:30:38Z")

</div>

Could you try running pip install protobuf==3.20.1?

It should install 3.20.1 to your current enviroment.

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [April 18, 2024, 3:04pm UTC](https://community.wandb.ai/t/failed-to-import-wandb-after-updating-to-wandb-0-16-6/6361/7 "2024-04-18T15:04:39Z")

</div>

Hi there, I wanted to follow up on this request. Please let us know if we can be of further assistance or if your issue has been resolved.

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [April 22, 2024, 2:53pm UTC](https://community.wandb.ai/t/failed-to-import-wandb-after-updating-to-wandb-0-16-6/6361/8 "2024-04-22T14:53:38Z")

</div>

Hi, since we have not heard back from you, we are going to close this request. If you would like to reopen the conversation, please let us know! Unfortunately, at the moment, we do not receive notifications if a thread reopens on Discourse. So, please feel free to create a new ticket regarding your concern if you’d like to continue the conversation.
