#🔒 Protobuf version conflict: TensorFlow 2.11 needs <3.20, OpenTelemetry-Proto needs ≥5.0
133 messages · Page 1 of 1 (latest)
@valid elm
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
does it need to be specifically those versions? Can't you just pip install langfuse opentelemetry-proto tensorflow protobuf?
no need for these versions
I only use tensorflow==2.11.0 in my code
but the other is installed beased on the warning
you mean i should uninstall all these libraries and then install all
with the same line?
you could or just upgrade the package that you want
pip install protobuf --upgrade for example
as of my understaing leting pip to determine the versions will led to an issue and conflicts
I doubt that
Because leaving it to pip to detemine the versions will safely rely the current version of Python in the environment and checking the version of the package that is compatible with that environment and install the latest stable version (unless otherwise version number is specified)
would upgrading tensorflow solve this?
will test this and let you know
unfortunately no
i use 3.15.0 and 3.16.1
of what
it seems its a common issue
does the latest tensorflow also limit the upper bound of protobuf?
no, the latest tensorflow requires protobuf>=5.28.0
yes but thats will make a conflict with opentelemetry‑proto
why would it?
i try to find a versions for all these that can works toghter
you said it yourself: opentelemetry‑proto 1.36.0 requires protobuf<7.0,>=5.0
so where would the conflict come from?
so install tensorflow with 3.16.1
and
langfuse==3.2.2
opentelemetry‑proto==1.36.0
protobuf==3.20.3
will solve the issue
uh, no
did you not see what I just wrote? opentelemetry-proto requires protobuf higher or equal to 5.0
Install tensorflow==3.16.1, then install the rest without version pinning and it should workâ„¢
i do like this but got this error
tensorflow 2.16.1 has requirement protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3, but you have protobuf 6.31.1.
i think we need to specify the version of protobuf
uninstall all packages and then install tensorflow==3.16.1, and then the rest without version pinning
Why? How?
If you install all at once (one command with all, or one requirements.txt file), it will try to match all requirements.
Your file doesn't work because it has all requirements set as == and they have conflicting deps.
Removing all reqs (all ==ver) from the file and just running it will be the same as running pip install langfuse opentelemetry-proto tensorflow protobuf and will make pip cross-check all dependency requirements and choose versions of all libs that match those (NOT choose newest of each).
(But ONLY if you run it like this together, installing one-by-one means it only checks the lib currently being installed - that might be what you heard.)
After the versions get automatically determined like this, you'd freeze the reqs as a new requirements.txt file or other format you use.
You said 2.16.1 but Q said 3.16.1
i think he mean 2.16.1
I copied what you wrote
!pip tensorflow
yes my bad sorry
What Python version are you using? 3.12?
3.9
this remove all conflicts
but with lower versions
Name: tensorflow
Version: 2.9.0
With highest non-conflicting versions. Which is the point
no i mean install with. this line
pip install langfuse opentelemetry-proto tensorflow protobuf
use a version of Tensorflow
2.9.0
3.9 eol is scheduled for October
And those are exactly the highest non-conflicting versions
You could try adding a requirement to tensorflow ONLY with the whole command, but pip will most likely not find anything. (I guess it could still find something if it traded one lib's higher version for tf lower, when one lib didn't have an upper bound on the dep... But that's reallt an edge case)
Is this the target Tensorflow version you want?
a shared project and we use this vresion of python
Laugh react to someone helping asking a valid question? I'm out. Bye.
Fair enough
so is there something preventing you from using a later release of tensorflow, one that's compatible with protobuf 5?
no no
@shrewd vine suggest that i can install all librires using these line
pip install langfuse opentelemetry-proto tensorflow protobuf
when i use it i got no conflicts but the pip decide that the sutable version of tensorflow is 2.9.0
still the same
I find that hard to believe
lemme try
these casue this issue
tensorflow 2.16.1 requires protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3, but you have protobuf 6.31.1 which is incompatible.
i just copy this line
pip install -U langfuse opentelemetry-proto tensorflow protobuf
no magic 😂
Because you are still specifying the version in protobuf. You didn't uninstall your packages and the currently installed protobuf is 6.31.1
no
i did
pip install tensorflow==2.16.1
then
pip install langfuse opentelemetry-proto protobuf
I've installed Tensorflow 2.16.1. These are the compatible versions with it. This is in Python 3.9
i have a requirements file
i can specify all versions there also
I just created a fresh Python 3.9 virtualenv, then did pip install langfuse opentelemetry-proto protobuf tensorflow. Everything installed fine, no conflicts.
Do you know how to uninstall packages?
pip uninstall ...
yes i told this
no conflicts
what's the problem then
but with version of Tensrflow 2.9
That's literally opposite of what you were told. You were told that if you add any version requirement to do it in the long-ass command.
Also, according to your own error, you did not uninstall the protobuf 6.31.1 you had installed previously. Pip DOES NOT downgrade the packages for you, so it settled for tf 2.9 which didn't have an upper bound for protobuf.
for the record, tensorflow 2.20.0rc1 is compatible with protobuf 6
sorry i update it
oriented details
OP didn't uninstall protobuf 6.31.1 they installed previously (see this error #1403016930939506788 message) and thus pip is choosing the newest tf which didn't have upper bound for protobuf - which is 2.9.
Pip doesn't downgrade already installed packages (probably unless you tell it with some flag) so it can't choose newer tf while keeping the installed protobuf
@valid elm so could you just wipe your virtualenv and start from scratch?

would probably be easier for everyone that way
can someone validated these versions
tensorflow==2.16.1
langfuse==2.60.9
protobuf==4.25.8
opentelemetry-proto==1.27.0
yes will do that
but install using requirements file
got from here
what's in your requirements file?
You can validate it by installing it yourself. Just make a new venv or something
if it contains exact version pins then this might be pointless
Again, you were told the req file does NOT NEED hard version reqs.
You were told to just run the command in clean environment and then freeze the resulting reqs. Just like Agent Q did there.
You didn't even say what operating system you're using, so using Agent Q's versions might be incorrect
🙋 I'm using Ubuntu btw but I don't think that matters 
@stray kettle What is the verison of Tensrflow installed when you run the previous line
Guess 
Wheels are python ver x OS, so if OP runs a different architecture it may matter.
I'm mostly pointing out that OP is ignoring clear instructions and doing their own thing
No
I just try to understand what you are saying
but because my mother language is not english i don't do that well
sorry
(neither is mine)
(Neither is mine)
(Malay is my first language)
Do the following:
- Make a new venv
- pip install tensorflow, protobuf, langfuse, opentelemetry-proto in the new activated venv
- pip freeze into a new requirements.txt file
*pip install the long command - the one with ALL the main libs and no versions specified
No separate commands, no installing from file. Just that one long command
ok to be clear
I use Mac as an OS. I worked on a shared Django project
I need to use langfuse to track a LLM
project contains predefained Tensrflow with version 2.11.0
so change the predefined tensorflow to something newer
Are you running Django inside Docker or something?
yes
im still new to python my experince is with .net
i will do
pip install -U tensorflow
No. You were supposed to use the long pip install command with all the main libs. Not install tf separately with your own version requirement
ok
i need to use this
pip3 install -U langfuse opentelemetry-proto tensorflow protobuf
right?
It seems that the conflict comes from the incompatible versions of protobuf: Maybe you can
-
First uninstall all conflicting libraries:
pip uninstall tensorflow langfuse opentelemetry-proto protobuf -
Install the compatible version of TensorFlow (for example, tensorflow==2.16.1), because it is compatible with a newer protobuf version:
pip install tensorflow==2.16.1
Then, install the other libraries without specifying a version:
pip install langfuse opentelemetry-proto protobuf
This allows pip to choose the correct compatible versions between them.
50/50 😅
I do exactly what you are doing
but got this error
tensorflow 2.16.1 requires protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3, but you have protobuf 6.31.1 which is incompatible.
do that step by step
Again, you didnt make a fresh environment
The steps are HERE #1403016930939506788 message
First step is to make a new clean environment. New environment won't have protobuf 6.31.1 installed because it won't have any libs installed
ok
thank you all for your help
Indeed, protobuf 6.31.1 is installed in your current environment, which causes the conflict with tensorflow==2.16.1.
I advise you to follow these steps in a new virtual environment:
- Create a new virtual environment:
python -m venv mon_env
Activate this environment:
-
On Windows:
mon_env\Scripts\activate -
On macOS/Linux:
source mon_env/bin/activate
Then install the packages one by one, as follows:
pip install langfuse opentelemetry-proto protobuf```
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.