gnmi icon indicating copy to clipboard operation
gnmi copied to clipboard

Unable to import gnmi_pb2.py due to gnmi_ext import

Open colinmcintosh opened this issue 6 years ago • 6 comments

The import for the gnmi_ext package in gnmi_pb2.py here

https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi_pb2.py#L19

doesn't actually exist in any package as far as I can tell and makes it impossible to import gnmi_pb2.py in Python. Could someone point me towards how to import this module correctly?

colinmcintosh avatar Jul 31 '18 20:07 colinmcintosh

This file was last regenerated on June 20. Is your repository synced to head?

https://github.com/openconfig/gnmi/blob/master/proto/gnmi_ext/gnmi_ext_pb2.py

On Tue, Jul 31, 2018 at 1:50 PM Colin McIntosh [email protected] wrote:

The import for the gnmi_ext package in gnmi_pb2.py here

https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi_pb2.py#L19

doesn't actually exist in any package as far as I can tell and makes it impossible to import gnmi_pb2.py in Python. Could someone point me towards how to import this module correctly?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openconfig/gnmi/issues/34, or mute the thread https://github.com/notifications/unsubscribe-auth/ARfIL84UknZKu6PdnzRXoRdQOmeeE0X2ks5uMMMwgaJpZM4VpY1Z .

gcsl avatar Aug 02 '18 18:08 gcsl

I can take a look at this. Apologies for the latency.

robshakir avatar Aug 03 '18 19:08 robshakir

I'm having this same issue. Is there a workaround or procedure to make this work?

mathershifter avatar Nov 07 '18 18:11 mathershifter

I can not find the descriptor.proto file in the import path: import "google/protobuf/descriptor.proto"; I searched around, could not locate "proto3" version of "descriptor.proto". Could someone help?

HelenHZhang avatar Feb 19 '19 15:02 HelenHZhang

It looks like @remingtonc was able to workaround this issue and generate the appropriate Python modules from the .proto file here: https://github.com/cisco-ie/cisco-gnmi-python/blob/2de751029fba7baabe9f69406129f2b7f1d9683b/update_protos.sh

An example of the correctly generated Python modules are located here: https://github.com/cisco-ie/cisco-gnmi-python/tree/master/src/cisco_gnmi/proto

colinmcintosh avatar Mar 04 '20 20:03 colinmcintosh

This is still a major problem. I tried following instructions from here and here, but I found my self spending hours messing with source files and changing file paths and directory structure. Finally had to stop as this whole processes is messy and did not seem right. Is this behavior expected? Can someone fix this please? @colinmcintosh, I tried the bash script, ran into errors (couldn't copy from github locations).

davehouser1 avatar Jul 02 '21 16:07 davehouser1