#🔒 Protobuf version conflict: TensorFlow 2.11 needs <3.20, OpenTelemetry-Proto needs ≥5.0

133 messages · Page 1 of 1 (latest)

cinder lodgeBOT
#

@valid elm

Python help channel opened

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.

stray kettle
#

does it need to be specifically those versions? Can't you just pip install langfuse opentelemetry-proto tensorflow protobuf?

valid elm
#

you mean i should uninstall all these libraries and then install all

#

with the same line?

stray kettle
#

you could or just upgrade the package that you want

#

pip install protobuf --upgrade for example

valid elm
stray kettle
#

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)

versed tide
#

would upgrading tensorflow solve this?

valid elm
versed tide
#

of what

valid elm
#

it seems its a common issue

versed tide
#

does the latest tensorflow also limit the upper bound of protobuf?

#

no, the latest tensorflow requires protobuf>=5.28.0

valid elm
#

yes but thats will make a conflict with opentelemetry‑proto

versed tide
#

why would it?

valid elm
#

i try to find a versions for all these that can works toghter

versed tide
#

you said it yourself: opentelemetry‑proto 1.36.0 requires protobuf<7.0,>=5.0

#

so where would the conflict come from?

valid elm
#

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

versed tide
#

uh, no

#

did you not see what I just wrote? opentelemetry-proto requires protobuf higher or equal to 5.0

stray kettle
valid elm
#

i think we need to specify the version of protobuf

stray kettle
shrewd vine
# valid elm as of my understaing leting pip to determine the versions will led to an issue a...

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.

shrewd vine
stray kettle
#

!pip tensorflow

cinder lodgeBOT
#

TensorFlow is an open source machine learning framework for everyone.

Released on <t:1741741688:D>.

valid elm
stray kettle
valid elm
#

but with lower versions

#

Name: tensorflow
Version: 2.9.0

shrewd vine
valid elm
#

no i mean install with. this line
pip install langfuse opentelemetry-proto tensorflow protobuf

#

use a version of Tensorflow

#

2.9.0

shrewd vine
shrewd vine
versed tide
#

what's that about 2.9.0?

#

of what

valid elm
stray kettle
shrewd vine
#

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)

stray kettle
valid elm
shrewd vine
#

Laugh react to someone helping asking a valid question? I'm out. Bye.

stray kettle
versed tide
#

so is there something preventing you from using a later release of tensorflow, one that's compatible with protobuf 5?

valid elm
versed tide
#

add -U

#

pip install -U ...

valid elm
versed tide
#

I find that hard to believe

stray kettle
#

lemme try

valid elm
valid elm
#

no magic 😂

stray kettle
valid elm
stray kettle
#

I've installed Tensorflow 2.16.1. These are the compatible versions with it. This is in Python 3.9

valid elm
#

i have a requirements file
i can specify all versions there also

versed tide
#

I just created a fresh Python 3.9 virtualenv, then did pip install langfuse opentelemetry-proto protobuf tensorflow. Everything installed fine, no conflicts.

stray kettle
#

pip uninstall ...

versed tide
#

what's the problem then

valid elm
#

but with version of Tensrflow 2.9

shrewd vine
versed tide
#

for the record, tensorflow 2.20.0rc1 is compatible with protobuf 6

valid elm
#

sorry i update it
oriented details

shrewd vine
#

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

versed tide
#

@valid elm so could you just wipe your virtualenv and start from scratch?

stray kettle
versed tide
#

would probably be easier for everyone that way

valid elm
#

can someone validated these versions

tensorflow==2.16.1
langfuse==2.60.9
protobuf==4.25.8
opentelemetry-proto==1.27.0

valid elm
#

but install using requirements file

versed tide
#

what's in your requirements file?

stray kettle
versed tide
#

if it contains exact version pins then this might be pointless

shrewd vine
# valid elm got from here

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

stray kettle
#

🙋 I'm using Ubuntu btw but I don't think that matters pithink

valid elm
#

@stray kettle What is the verison of Tensrflow installed when you run the previous line

shrewd vine
valid elm
#

I just try to understand what you are saying

#

but because my mother language is not english i don't do that well

#

sorry

versed tide
#

(neither is mine)

shrewd vine
#

(Neither is mine)

stray kettle
#

(Malay is my first language)

stray kettle
shrewd vine
#

No separate commands, no installing from file. Just that one long command

valid elm
#

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

versed tide
#

so change the predefined tensorflow to something newer

valid elm
#

ok i uninstall the tensorflow then install the lateset stable version

#

whihc is 2.16.1

versed tide
#

no it's not

#

we already established that

stray kettle
valid elm
#

im still new to python my experince is with .net

valid elm
shrewd vine
valid elm
warm wren
#

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 😅

valid elm
#

do that step by step

shrewd vine
#

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

valid elm
#

ok
thank you all for your help

warm wren
#

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```
cinder lodgeBOT
#
Python help channel closed using Discord native close action

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.