Python Forum
trying to locate a working grpc to install
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
trying to locate a working grpc to install
#1
I am trying to find a working grpc to install.
The command I tried and result was
>py -m pip install grpc
Collecting grpc
Using cached https://files.pythonhosted.org/packages/...-19.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\major\AppData\Local\Temp\pip-install-mybqpm3g\grpc\setup.py", line 7, in <module>
version_tuple = __import__('grpc').VERSION
File "C:\Users\major\AppData\Local\Temp\pip-install-mybqpm3g\grpc\grpc\__init__.py", line 6, in <module>
from .rpc import *
File "C:\Users\major\AppData\Local\Temp\pip-install-mybqpm3g\grpc\grpc\rpc.py", line 141
except OSError, ex:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\major\AppData\Local\Temp\pip-install-mybqpm3g\grpc\

SO any1 give me a hint as to where I can get a good version?
Reply
#2
python version?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
pip install grpc will try to install this package - https://pypi.org/project/grpc/
As you can see it's not updated since 2016, i.e. looks not maintained any longer

better check this one
https://pypi.org/project/grpcio/
for it there are also windows binaries on Gohlke

or this one
https://pypi.org/project/grpcalchemy/
https://pypi.org/project/grpcalchemy/
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#4
Ok thanks for that.
I have installed grpcio and re-ran what I was trying and got a module not found error from an import grpc.
I changed the py file to use grpcio instead and got the same error.
I did pip show grpcio and got
Name: grpcio
Version: 1.18.0
Summary: HTTP/2-based RPC framework
Home-page: https://grpc.io
Author: The gRPC Authors
Author-email: [email protected]
License: Apache License 2.0
Location: c:\users\major\appdata\roaming\python\python37\site-packages
Requires: six
Required-by: aiogrpc

I checked the site-packages folder and could not find a sub folder called grpcio.
There is one called grpcio-1.18.0.dist-info
At the moment I am confused again.

p.s. any1 tell me why my profile has 'Programmer Named Tim' under my logo?
Reply
#5
(May-09-2019, 05:26 PM)MrMajorThorburn Wrote: p.s. any1 tell me why my profile has 'Programmer Named Tim' under my logo?
https://python-forum.io/misc.php?action=help&hid=29
as to your question - I can only refer you to the docs of the package https://grpc.io/docs/
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#6
Quick test,homepage
Doing it in virtual environment,it's now build into Python newer versions as you use 3.7.
E:\div_code
λ python -m venv grpv_env

E:\div_code
λ cd grpv_env\

E:\div_code\grpv_env
λ E:\div_code\grpv_env\Scripts\activate

# Install into environment
(grpv_env) E:\div_code\grpv_env
λ pip install grpcio
Collecting grpcio
  Downloading .....
Installing collected packages: six, grpcio
Successfully installed grpcio-1.20.1 six-1.12.0

(grpv_env) E:\div_code\grpv_env
λ pip install ptpython
Collecting ptpython ....
  Installing collected packages: parso, jedi, docopt, pygments, wcwidth, prompt-toolkit, ptpython
Successfully installed docopt-0.6.2 jedi-0.13.3 parso-0.4.0 prompt-toolkit-2.0.9 ptpython-2.0.4 pygments-2.4.0 wcwidth-0.1.7
I also install ptpython into environment,this make a lot easier to explore a package that not has so much Python documentation.
(grpv_env) E:\div_code\grpv_env
λ ptpython
>>> import grpc

>>> grpc.__version__
'1.20.1'
So there is a lot of method under grpc eg grpc.Call ect...
As i using ptpython all methods is showing up automatically after grpc.,with doc string.
There is a lot method if list all without special methods(__something__).
Output:
>>> [i for i in dir(grpc) if not i.startswith('__')] ['AuthMetadataContext', 'AuthMetadataPlugin', 'AuthMetadataPluginCallback', 'Call', 'CallCredentials', 'Channel', 'ChannelConnectivity', 'ChannelCredentials', 'ClientCallDetails', 'Future', 'FutureCancelledError', 'FutureTimeoutError', 'GenericRpcHandler', 'HandlerCallDetails', 'RpcContext', 'RpcError', 'RpcMethodHandler', 'Server', 'ServerCertificateConfiguration', 'ServerCredentials', 'ServerInterceptor', 'ServiceRpcHandler', 'ServicerContext', 'Status', 'StatusCode', 'StreamStreamClientInterceptor', 'StreamStreamMultiCallable', 'StreamUnaryClientInterceptor', 'StreamUnaryMultiCallable', 'UnaryStreamClientInterceptor', 'UnaryStreamMultiCallable', 'UnaryUnaryClientInterceptor', 'UnaryUnaryMultiCallable', '_create_servicer_context', '_cygrpc', '_cython', '_grpcio_metadata', 'abc', 'access_token_call_credentials', 'channel_ready_future', 'composite_call_credentials', 'composite_channel_credentials', 'contextlib', 'dynamic_ssl_server_credentials', 'enum', 'insecure_channel', 'intercept_channel', 'logging', 'metadata_call_credentials', 'method_handlers_generic_handler', 'secure_channel', 'server', 'six', 'ssl_channel_credentials', 'ssl_server_certificate_configuration', 'ssl_server_credentials', 'stream_stream_rpc_method_handler', 'stream_unary_rpc_method_handler', 'sys', 'unary_stream_rpc_method_handler', 'unary_unary_rpc_method_handler']
Version pip show:
(grpv_env) E:\div_code\grpv_env
λ pip show grpcio
Name: grpcio
Version: 1.20.1
Summary: HTTP/2-based RPC framework
Home-page: https://grpc.io
Author: The gRPC Authors
Author-email: [email protected]
License: Apache License 2.0
Location: e:\div_code\grpv_env\lib\site-packages
Requires: six
Required-by:
Looking at doc there is also pip install grpcio-tools
With a hello world example after clone from Repo.
So can do a test of that:
(grpv_env) E:\div_code\grpv_env
λ pip install grpcio-tools
Collecting grpcio-tools
  Downloading .....      
Installing collected packages: protobuf, grpcio-tools
Successfully installed grpcio-tools-1.20.1 protobuf-3.7.1

(grpv_env) E:\div_code\grpv_env
λ git clone -b v1.20.0 https://github.com/grpc/grpc
Cloning into 'grpc'...
Checking out files: 100% (10008/10008), done.
Test server --> client.
(grpv_env) E:\div_code\grpv_env\grpc\examples\python\helloworld ((no branch))
λ python greeter_server.py
Now in a other cmder window.
(grpv_env) E:\div_code\grpv_env\grpc\examples\python\helloworld ((no branch))
λ python greeter_client.py
Greeter client received: Hello, you!
Reply
#7
Ok so the greeter test worked.
So if this means I have a working grpc in my gitrep can I somehow install it from there?

It seems to me that trying to resolve my problem with grpc when the product has moved on and its function is now under grpcio that trying to fix my problem with grpc is a waste of everyone's time.

I have other errors I want to ask about so will raise an new item for the next one and leave this to die.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  My minoconda3 install is not working. Led_Zeppelin 1 1,463 Jan-26-2022, 09:49 PM
Last Post: snippsat
  install.bat pymem not working? ChickenNugget 1 1,788 Oct-31-2021, 02:04 PM
Last Post: snippsat
  How do I locate setup.py in my computer, or install the file? JaneTan 1 1,698 Aug-26-2021, 08:37 AM
Last Post: snippsat
Photo i want to locate an image according to the mouse position rachidel07 1 2,785 Feb-08-2021, 03:29 PM
Last Post: michael1789
  Pip install for mysqlclient not working burvil 4 50,622 Feb-04-2021, 08:16 PM
Last Post: nilamo
  Locate QR code on a page Pedroski55 0 1,346 Jan-21-2021, 07:11 AM
Last Post: Pedroski55
  TA-Lib pip install not working Mac (Fix Found) DrinkinBeer 3 7,752 Jan-15-2021, 03:04 AM
Last Post: DrinkinBeer
Photo Locate Noise floor level for a spectral data in Python Ranjan_Pal 1 2,991 Dec-19-2020, 10:04 AM
Last Post: Larz60+
  How to Locate an Attribute's Parent Object? calvinsomething 5 2,932 Nov-13-2020, 01:52 AM
Last Post: calvinsomething
  Locate user input in a string. MjBaca 3 3,168 Apr-23-2018, 06:55 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020