Skip to main content

No project description provided

Project description

Package for gRPC Python tools.

Installation

The gRPC Python tools package is available for Linux, Mac OS X, and Windows running Python 2.7.

From PyPI

If you are installing locally…

$ pip install grpcio-tools

Else system wide (on Ubuntu)…

$ sudo pip install grpcio-tools

If you’re on Windows make sure that you installed the pip.exe component when you installed Python (if not go back and install it!) then invoke:

$ pip.exe install grpcio-tools

Windows users may need to invoke pip.exe from a command line ran as administrator.

n.b. On Windows and on Mac OS X one must have a recent release of pip to retrieve the proper wheel from PyPI. Be sure to upgrade to the latest version!

You might also need to install Cython to handle installation via the source distribution if gRPC Python’s system coverage with wheels does not happen to include your system.

From Source

Building from source requires that you have the Python headers (usually a package named python-dev) and Cython installed. It further requires a GCC-like compiler to go smoothly; you can probably get it to work without GCC-like stuff, but you may end up having a bad time.

$ export REPO_ROOT=grpc  # REPO_ROOT can be any directory of your choice
$ git clone -b $(curl -L http://grpc.io/release) https://github.com/grpc/grpc $REPO_ROOT
$ cd $REPO_ROOT
$ git submodule update --init

$ cd tools/distrib/python/grpcio_tools
$ python ../make_grpcio_tools.py

# For the next command do `sudo pip install` if you get permission-denied errors
$ pip install .

You cannot currently install Python from source on Windows. Things might work out for you in MSYS2 (follow the Linux instructions), but it isn’t officially supported at the moment.

Troubleshooting

Help, I …

  • … see a pkg_resources.VersionConflict when I try to install grpc

    This is likely because pip doesn’t own the offending dependency, which in turn is likely because your operating system’s package manager owns it. You’ll need to force the installation of the dependency:

    pip install --ignore-installed $OFFENDING_DEPENDENCY

    For example, if you get an error like the following:

    Traceback (most recent call last):
    File "<string>", line 17, in <module>
     ...
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 509, in find
      raise VersionConflict(dist, req)
    pkg_resources.VersionConflict: (six 1.8.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.10'))

    You can fix it by doing:

    sudo pip install --ignore-installed six
  • … see compiler errors on some platforms when either installing from source or from the source distribution

    If you see

    /tmp/pip-build-U8pSsr/cython/Cython/Plex/Scanners.c:4:20: fatal error: Python.h: No such file or directory
    #include "Python.h"
                    ^
    compilation terminated.

    You can fix it by installing python-dev package. i.e

    sudo apt-get install python-dev

    If you see something similar to:

    third_party/protobuf/src/google/protobuf/stubs/mathlimits.h:173:31: note: in expansion of macro 'SIGNED_INT_MAX'
    static const Type kPosMax = SIGNED_INT_MAX(Type); \\
                               ^

    And your toolchain is GCC (at the time of this writing, up through at least GCC 6.0), this is probably a bug where GCC chokes on constant expressions when the -fwrapv flag is specified. You should consider setting your environment with CFLAGS=-fno-wrapv or using clang (CC=clang).

Usage

Given protobuf include directories $INCLUDE, an output directory $OUTPUT, and proto files $PROTO_FILES, invoke as:

$ python -m grpc.tools.protoc -I$INCLUDE --python_out=$OUTPUT --grpc_python_out=$OUTPUT $PROTO_FILES

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grpcio_tools-0.15.1.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

grpcio_tools-0.15.1-cp27-cp27mu-manylinux1_x86_64.whl (18.1 MB view details)

Uploaded CPython 2.7mu

grpcio_tools-0.15.1-cp27-cp27m-win_amd64.whl (1.5 MB view details)

Uploaded CPython 2.7m Windows x86-64

grpcio_tools-0.15.1-cp27-cp27m-manylinux1_x86_64.whl (18.1 MB view details)

Uploaded CPython 2.7m

grpcio_tools-0.15.1-cp27-cp27m-macosx_10_10_intel.whl (2.8 MB view details)

Uploaded CPython 2.7m macOS 10.10+ intel

File details

Details for the file grpcio_tools-0.15.1.tar.gz.

File metadata

File hashes

Hashes for grpcio_tools-0.15.1.tar.gz
Algorithm Hash digest
SHA256 89bb502dda50ed5b4988adb2d296480c16721f12b5862a4abc4465a0d56c87b9
MD5 07df53cfb67cd85c2d861ed2a1557f58
BLAKE2b-256 24e31db7c75911d3f9c93064f3db928c18e79acf4f64edd9b67a5ac364b084ae

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-0.15.1-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for grpcio_tools-0.15.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1c2caaf2259dbfc9ee5010368fc19a9c3a321846b0d09aa743ce4db87adbb0ce
MD5 f175f1f38d2662a5c3d261228fa1ce68
BLAKE2b-256 9fe1a76b68e7e109b6a04fc0eb6fda3e3157fe88b56a0b120193cde6b42aa80a

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-0.15.1-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for grpcio_tools-0.15.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 9017ffc3be7c6b8fdabd236a9f3f0aa36208cee1030a11604c2b8c22e5a70f14
MD5 9c5d932d98f22f7be898b7537ffcc5a9
BLAKE2b-256 ee350dc90dd3ba3678641b2b8811638819eafc88e0c7728473d0aa0a9f0dc4bc

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-0.15.1-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for grpcio_tools-0.15.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e66408c60e97fa597d645b69ec3b982b7ff638d603b9ce02266dbf0200e7231d
MD5 cf34610d529c7091f8dc4ff28a8038ac
BLAKE2b-256 ac172e00ecf917fde810bc1134c208ebf876ec9df7e92622014f180d3d4d8c48

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-0.15.1-cp27-cp27m-macosx_10_10_intel.whl.

File metadata

File hashes

Hashes for grpcio_tools-0.15.1-cp27-cp27m-macosx_10_10_intel.whl
Algorithm Hash digest
SHA256 edd737f0b6fbc24e17e83a2590288c73ba941bce0d50715424d38357ec049096
MD5 a503a6525b7fd4d61484849ceb364c36
BLAKE2b-256 7fc42c3bebd4ae4f0bd832a0cec09dc7d6201144dd877baf7d491675eb96829c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page