google / google/tf-quant-finance

Update `protobuf` version

Open
#111 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.5k
Forks
698
PR merge metrics
No merged PRs in 30d

Description

Hello,

I noticed that when installing `tff` on Google Colab, I encounter the following error when trying to import it:

```
TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
```

To work around this, I have to manually install `protobuf>=3.20.3` and restart the session, which disrupts the workflow.

Would it be possible to update the `protobuf` dependency in the package to avoid this issue? This would improve the out-of-the-box experience, especially for users running the library in cloud-based environments like Colab.

Thanks!

Contributor guide

Open the contributing guide

Research direction

Start by locating the package dependency metadata and reproduce the reported import failure in a clean environment resembling Google Colab. Update the protobuf dependency so installation no longer requires a manual upgrade, then verify that installing the package and importing it succeeds without the descriptor error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.