Re: [grpc-io] Error with pb2 file (with python 3)

2017-03-01 Thread ericYoon
Hi, sorry for late reply.

The IDE i am using is Eclipse 4.6.2 with pydev (PyDev for Eclipse 
5.4.0.201611281236)

When I run python 3.5 and try to import the same error occurs.

eric@diot:~/src/SPT_DIOT/snooopy/src$ PYTHONPATH=. python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ccodeServer.grpcComm import ccodeMan_pb2
>>> from ccodeServer.grpcComm import ccodeMan_pb2_grpc
Traceback (most recent call last):
 File "", line 1, in 
 File 
"/home/eric/src/SPT_DIOT/snooopy/src/ccodeServer/grpcComm/ccodeMan_pb2_grpc.py"
, line 6, in 
   import ccodeMan_pb2 as ccodeMan__pb2
ImportError: No module named 'ccodeMan_pb2'

After fixing import manually 
Auto generated: import ccodeMan_pb2 as ccodeMan__pb2
Manually fixed: from ccodeServer.grpcComm import ccodeMan_pb2 as 
ccodeMan__pb2

>>> from ccodeServer.grpcComm import ccodeMan_pb2_grpc
>>>

No more error occured.

This might be my path issue but IMHO, import path does not accept relative 
path from Pyhon 3 (in Pyhon 3, relative import path was accepted so there 
was no such issue)

Regards,

-- 
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/df6fccac-ce95-4307-ba68-52b94cc7236e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Error with pb2 file (with python 3)

2017-02-02 Thread ericYoon
Hello,

I am new to python and also grpc. So this might be my fault.

My grpc tool generates pb2 and pb2_grpc file into "someDir/src/adminServer/" 
where my working directory is "src".

In this case, my IDE and python 3.5 command line display error like the 
following:

*Error with pb2 file:*

File "/home/eric/dev/myproject/src/adminServer/adminServer_pb2_grpc.py", 
line 6, in 
import adminServer_pb2 as adminServer__pb2
ImportError: No module named 'adminServer_pb2'

--

If I change the line 6 into the following, error disappears: 

from adminServer import adminServer_pb2 as adminServer__pb2

---

I guess these errors were raised due to  python 3 import rule (these worked 
with python 2).

If there is a way to make grpc tool generate code compatible to python 3, 
it will be wonderful...

Could anyone answer?

-- 
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/75287868-4219-4f43-b6f8-3d08ec180339%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] import error in ..._pb2 and ..._pb2_grpc (python 3.6 command line and Eclipse/pydev/pydev/python3.6)

2017-02-02 Thread ericYoon
Hello,

I am new to python and also grpc. So this might be my fault.

My grpc tool generates pb2 and pb2_grpc file into 
"/home/eric/dev/myproject/src/adminServer/" where my working directory is 
"src".

In this case, my IDE and python command line display error like the 
following:

*Error with pb2 file:*

*command line (python 3.6):*

File "/home/eric/dev/myproject/src/adminServer/adminServer_pb2_grpc.py", 
line 6, in 
import adminServer_pb2 as adminServer__pb2
ImportError: No module named 'adminServer_pb2'

*IDE (Eclipse/pydev/python 3.6):*

"unresolved import adminServer__pb2"

- adminServer_pb2_grpc.py file line 6 (import adminServer_pb2 as 
adminServer__pb2)

--

If I change the line 6 into the following, error disappears: 

from adminServer import adminServer_pb2 as adminServer__pb2

*Error with pb2_grpc file:*

*command line (python 3.6):*

  File 
"/home/eric/dev/SPT_DIOT/MySingleSmartContract/src/ccodeServer/peerAgent_pb2_grpc.py",
 
line 7, in 
import peerAgent_pb2 as peerAgent__pb2
ImportError: No module named 'peerAgent_pb2'

---

I guess these errors were raised due to  python 3 import rule (these worked 
with python 2).
If there is a way to make grpc tool generate python 3 compatible code, it 
will be wonderful...


-- 
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/be909e1e-efb1-4bcd-81e0-1ee2bd4f5804%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.