On Tue, Dec 13, 2016 at 9:51 AM, <ccl...@dieselpoint.com> wrote: > I'm a Python newbie, perhaps this is just my misunderstanding of Python... > > I'm getting import errors. I generated some _pb2 files from my .proto file > using this: > > python -m grpc.tools.protoc -I/path/to/proto/dir/proto --python_out=. > --grpc_python_out=. /path/to/proto/dir/proto/myprotofile.proto > > It created myprotofile_pb2.py and myprotofile_pb2_grpc.py and put them in > my Python package directory. > > When I open myprotofile_pb2.py in Eclipse/PyDev, it gives me the error > "Unresolved import: _descriptor" on this line: > > from google.protobuf import descriptor as _descriptor > > and when I try to run my own code that imports it using "from . import > dieseldb_pb2", I get "SystemError: Parent module '' not loaded, cannot > perform relative import" > > Running "pip install protobuf" generates "Requirement already satisfied", > so that's not the problem. > > What am I doing wrong? > > (I'm using the latest version of everything. Python 3.5.2.) >
Nothing obvious is springing to mind. What's the output of "pip freeze"? Are you working with a virtual environment, the Python environment on your system (what is your system?), or some other Python environment? ... and all of Masood's questions. :-P -Nathaniel -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAEOYnASsVNAszXA8%2BF%2BezJpLw%2BBFgzbNXrJJNfL1t5yj69xixw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
smime.p7s
Description: S/MIME Cryptographic Signature