Package grpcio with py2exe

148 views
Skip to first unread message

falu...@gmail.com

unread,
Nov 17, 2017, 2:29:34 PM11/17/17
to grpc.io
Hi there,

Is it possible to package grpcio with py2exe?

I tried packing up grpcio on windows 7 32 bit using py2exe with python 2.7.11. Py2exe is able to detect dependencies but it does not package beta folder inside grpc module.

When I try to run that the generated .exe from py2exe on my windows 7 machine which has 32-bit python version 2.7.13 I get run time error. But when I try to replace grpc package compiled on my machine and try to run the generated .exe from py2exe it works fine.

My question is does grpcio has to be compiled on machine where you want to run it?

Cheers,
Falguni

Ken Payson

unread,
Nov 17, 2017, 2:39:14 PM11/17/17
to falu...@gmail.com, grpc.io
I'm not familiar with py2exe, but we release separate binary packages for Windows 32 and 64 bit Python.

If you are trying to build from source and distribute the binary package, I would expect some compatibility issues. 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@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/b502a67c-96c7-44d3-b526-36e516734102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

falu...@gmail.com

unread,
Nov 17, 2017, 2:51:32 PM11/17/17
to grpc.io
I am not building from source. I am using pip to install grpcio on that machine.

http://www.py2exe.org/index.cgi/Tutorial



On Friday, 17 November 2017 11:39:14 UTC-8, Ken Payson wrote:
I'm not familiar with py2exe, but we release separate binary packages for Windows 32 and 64 bit Python.

If you are trying to build from source and distribute the binary package, I would expect some compatibility issues. 
On Fri, Nov 17, 2017 at 11:29 AM, <falu...@gmail.com> wrote:
Hi there,

Is it possible to package grpcio with py2exe?

I tried packing up grpcio on windows 7 32 bit using py2exe with python 2.7.11. Py2exe is able to detect dependencies but it does not package beta folder inside grpc module.

When I try to run that the generated .exe from py2exe on my windows 7 machine which has 32-bit python version 2.7.13 I get run time error. But when I try to replace grpc package compiled on my machine and try to run the generated .exe from py2exe it works fine.

My question is does grpcio has to be compiled on machine where you want to run it?

Cheers,
Falguni

--
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+u...@googlegroups.com.

Ken Payson

unread,
Nov 17, 2017, 2:55:31 PM11/17/17
to falu...@gmail.com, grpc.io
Pip will choose a binary package from PyPI that matches your Python version/architecture.  If you attempt to redistribute that package, it may not match the client's Python version/architecture. 

To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.

falu...@gmail.com

unread,
Nov 17, 2017, 3:15:54 PM11/17/17
to grpc.io
It should not matter. Sorry my machine also has 32 bit python (Windows 64 bit). 

py2exe freezes python scripts.
"py2exe turns Python programs into packages that can be run on other Windows computers without needing to install Python on those computers. Python is needed on the computer where py2exe itself is run because py2exe is a Python program and it includes parts of Python in the package that is built."

 Ideally I don't need python on machine where I am running CLI.

The funny thing is if I enable debug mode on  my CLI which uses the module I don't see runtime error.

Ken Payson

unread,
Nov 17, 2017, 3:22:52 PM11/17/17
to falu...@gmail.com, grpc.io
This question might be better suited for a py2exe mailing list.

I'm not sure if py2exe supports binary python packages.  If it does (in a cross-compatible way), I would expect it to need to package multiple pip packages in the resulting exe.



To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.

falu...@gmail.com

unread,
Nov 17, 2017, 8:32:07 PM11/17/17
to grpc.io
Thanks Ken.

Now I am able to run it sometimes. I tried attaching windbg and saw abor exception for  "cygrpc!initcygrpc+". So initcygrpc is failing for some reason.

Ken Payson

unread,
Nov 20, 2017, 12:28:13 PM11/20/17
to falguni jhaveri, grpc.io
Can you post the full exception?

To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.

falu...@gmail.com

unread,
Nov 20, 2017, 12:58:54 PM11/20/17
to grpc.io
This  is what I see. I cannot debug further as I don't ave symbol files.


0a53f9d8 68388b07 68403e0c 02739db4 0a53fa2c cygrpc!initcygrpc+0xeabd6
0a53f9f8 6837e149 68403e0c 0a53fa2c 00000001 cygrpc!initcygrpc+0xeabd6
0a53fa08 68361cc5 0000019f 02739cb0 034f78d0 cygrpc!initcygrpc+0xe0218
0a53fa18 68361c01 034f78e4 073c2e80 fffffffe cygrpc!initcygrpc+0xc3d94
0a53fa2c 741b3c5a 00000014 02739ca0 6830396b cygrpc!initcygrpc+0xc3cd0
0a53fa48 682a5887 00000014 00000001 02739ca0 msvcr90!calloc+0x1a
0a53fa58 68303672 03bddbc4 00000001 6841dbdc cygrpc!initcygrpc+0x7956
0a53fa68 682a59fe 00000014 684aaaa0 025471c0 cygrpc!initcygrpc+0x65741
0a53fa88 68303efe 00000014 68303538 03291fd4 cygrpc!initcygrpc+0x7acd
0a53fa98 682a95d3 684b5804 682a9264 0a53fabc cygrpc!initcygrpc+0x65fcd
0a53fac8 682ff00d 00000000 03ce9974 6841dbdc cygrpc!initcygrpc+0xb6a2
0a53fae4 774ce172 01edeb79 00000028 0329df60 cygrpc!initcygrpc+0x610dc
0a53fb74 741b3c3a 0a53ff10 03bff878 01edeb51 ntdll!RtlAllocateHeap+0x206
0a53fc08 682a5887 00000004 00000001 0a53ffc4 msvcr90!free+0xec
0a53fc28 6830a7bf 0a53ff10 68403ca4 03bff878 cygrpc!initcygrpc+0x7956
00000000 00000000 00000000 00000000 00000000 cygrpc!initcygrpc+0x6c88e

Ken Payson

unread,
Nov 20, 2017, 1:07:19 PM11/20/17
to falguni jhaveri, grpc.io
I've never seen an error like this before, and without debug symbols I don't think I'll be able to provide any useful guidance.

initcygrpc is the module initialization function, so this indicates gRPC is failing to even load.  I would recommend getting guidance from py2exe on using binary package dependencies.

To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
Reply all
Reply to author
Forward
0 new messages