GoogleCloudPlatform / cloud-profiler-python

Stackdriver Profiler Python agent is a tool that continuously gathers CPU usage information from Python applications
Apache License 2.0
27 stars 23 forks source link

add `protobuf` version requirement #122

Closed jli closed 1 year ago

jli commented 2 years ago

google-cloud-profiler==4.0.0 seems to require at least protobuf>=3.20. it fails with protobuf-3.19.4:

$ python3 -m venv venv
$ source venv/bin/activate
$ pip install google-cloud-profiler==4.0.0 protobuf==3.19.4
$ python -c 'import googlecloudprofiler'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/j/venv/lib/python3.8/site-packages/googlecloudprofiler/__init__.py", line 19, in <module>
    from googlecloudprofiler import client
  File "/Users/j/venv/lib/python3.8/site-packages/googlecloudprofiler/client.py", line 41, in <module>
    from googlecloudprofiler import pythonprofiler
  File "/Users/j/venv/lib/python3.8/site-packages/googlecloudprofiler/pythonprofiler.py", line 23, in <module>
    from googlecloudprofiler import builder
  File "/Users/j/venv/lib/python3.8/site-packages/googlecloudprofiler/builder.py", line 19, in <module>
    from googlecloudprofiler import profile_pb2
  File "/Users/j/venv/lib/python3.8/site-packages/googlecloudprofiler/profile_pb2.py", line 19, in <module>
    from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (/Users/j/venv/lib/python3.8/site-packages/google/protobuf/internal/__init__.py)
AnandInguva commented 1 year ago

Is there a update on this one? We would like to use google-cloud-profiler==4.0.0 and protobuf==3.19.4. Seems like we need to downgrade the google-cloud-profiler

tvalentyn commented 1 year ago

@AnandInguva can you use protobuf>=3.20 ? would it resolve the issue?

punya commented 1 year ago

Fixed in ea964fc7.