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

To use as a build step in distutils-based projects, you may use the provided command class in your setup.py:

setuptools.setup(
  # ...
  cmdclass={
    'build_proto_modules': grpc.tools.command.BuildPackageProtos,
  }
  # ...
)

Invocation of the command will walk the project tree and transpile every .proto file into a _pb2.py file in the same directory.

Note that this particular approach requires grpcio-tools to be installed on the machine before the setup script is invoked (i.e. no combination of setup_requires or install_requires will provide access to grpc.tools.command.BuildPackageProtos if it isn’t already installed). One way to work around this can be found in our grpcio-health-checking package:

class BuildPackageProtos(setuptools.Command):
  """Command to generate project *_pb2.py modules from proto files."""
  # ...
  def run(self):
    from grpc.tools import command
    command.build_package_protos(self.distribution.package_dir[''])

Now including grpcio-tools in setup_requires will provide the command on-setup as desired.

For more information on command classes, consult distutils and setuptools documentation.

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-1.0.3.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

grpcio_tools-1.0.3-cp35-cp35m-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.5m Windows x86-64

grpcio_tools-1.0.3-cp35-cp35m-win32.whl (1.1 MB view details)

Uploaded CPython 3.5m Windows x86

grpcio_tools-1.0.3-cp35-cp35m-manylinux1_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.5m

grpcio_tools-1.0.3-cp35-cp35m-manylinux1_i686.whl (17.7 MB view details)

Uploaded CPython 3.5m

grpcio_tools-1.0.3-cp35-cp35m-macosx_10_9_intel.whl (3.1 MB view details)

Uploaded CPython 3.5m macOS 10.9+ intel

grpcio_tools-1.0.3-cp34-cp34m-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.4m Windows x86-64

grpcio_tools-1.0.3-cp34-cp34m-win32.whl (1.6 MB view details)

Uploaded CPython 3.4m Windows x86

grpcio_tools-1.0.3-cp34-cp34m-manylinux1_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.4m

grpcio_tools-1.0.3-cp34-cp34m-manylinux1_i686.whl (17.7 MB view details)

Uploaded CPython 3.4m

grpcio_tools-1.0.3-cp34-cp34m-macosx_10_9_intel.whl (3.1 MB view details)

Uploaded CPython 3.4m macOS 10.9+ intel

grpcio_tools-1.0.3-cp27-cp27mu-manylinux1_x86_64.whl (18.4 MB view details)

Uploaded CPython 2.7mu

grpcio_tools-1.0.3-cp27-cp27mu-manylinux1_i686.whl (17.7 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

grpcio_tools-1.0.3-cp27-cp27m-win32.whl (1.6 MB view details)

Uploaded CPython 2.7m Windows x86

grpcio_tools-1.0.3-cp27-cp27m-manylinux1_x86_64.whl (18.4 MB view details)

Uploaded CPython 2.7m

grpcio_tools-1.0.3-cp27-cp27m-manylinux1_i686.whl (17.7 MB view details)

Uploaded CPython 2.7m

grpcio_tools-1.0.3-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-1.0.3.tar.gz.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3.tar.gz
Algorithm Hash digest
SHA256 98a0781d8e83c96d56081c77d595f8223b74d7355db44bd69258e5f3aa5ce011
MD5 973ad338cec88ae1608cfe0754273bf4
BLAKE2b-256 ed60d69b6e82c6280c64a1f8aa1d1fa7736e3888fc5efdd7a502c208480aec84

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 542ed645f916c4668d29573032806439d03cedfebde11cb76ef5a7d81fd132c1
MD5 1eba83aa361a7beed68f8f5696574097
BLAKE2b-256 b06ec0af8e4a827e62fc763b1d8b455ff652f7fd7af97a826f0802afdb0fe24b

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 7f4370d199a94a299419734310a18a4907b0471c8e58c6906a606d723e078a87
MD5 499c7f8237b631d94e22a59955283c43
BLAKE2b-256 43ebbf015a86fe7826f9bbf081a9984dd4bd2f0eb6a6ee9f9395ce8309095034

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5ed17e3b15a6de96b81767885e9c0c06505a14ed7fa83fd330975005ed2bd558
MD5 dc9a60c6ab2360a31a0acf2fb2a19f4f
BLAKE2b-256 f8a8a1d1bea1bfa2c7fbae12bcb6abf1d2548baeb525977f0223a4afa6c1ab2b

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp35-cp35m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 b67922183e3b1d3d806b885ae15d608d0ff5074f8f79a04ffdb2abe6026ca88d
MD5 106a4b6d0313249536f87772ad34e2f4
BLAKE2b-256 28b992ffa4f7dcbd06e7a1c40cce04491addbaec247e9dea28aa5e5b275e5f0f

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp35-cp35m-macosx_10_9_intel.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp35-cp35m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 53122eaffa23468e5348ceca1b0bdf94f5018bd60844b65b873d6bb4a9f56a4e
MD5 315298ec332b5d76bdee310bdfa7717e
BLAKE2b-256 86953005d9b7288bb71fe99b0d9745ee18ca80a40b12fbc0f8f243239c052fda

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 93e9a440238322425ad6808c508f7ef5ebd242016126890dc885644252c55582
MD5 3aba76ba5325e36b99e264683800448f
BLAKE2b-256 e753f810644783cb8bfe7a4f40eee1db3f8235d5f38cfd32820159cbdb1a96c7

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 efe71a53552d4472636dee4f4ea35333c737460596f6d43b1760ff4d96da61bd
MD5 dd4228432bd0bb20ff76b5285e5c86dc
BLAKE2b-256 36176fd529fe987abc9089a06f8e312351a4260a32791686720cbd87935d0ce0

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bd135936376a8687779d819a04b0d4207f0087a0fa639374615b716672f6e1fa
MD5 ce92001c27b0172082e2279c8699bc93
BLAKE2b-256 3f210cbf453574cbba5b9e8a5cedc1ff77116f64eb5a029caedefb70455f5139

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp34-cp34m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f111dbe0af0bb1b2494ad5da41002ee48262f85fcfcb3a43c72c1b2b5c3ce22b
MD5 0aad745bc11d2aa429ff23cef5801f99
BLAKE2b-256 e4ea7670b4b8d673dca99170d83f4d3fcb3f6e9074b246d4b192daa0cc013346

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp34-cp34m-macosx_10_9_intel.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp34-cp34m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 a38b76e32ee3e3edf2b20caafba49d862f8ceafc47471475f47f03ea0bbb3066
MD5 cc514ece7c9e085d12ca4f09ad231ee8
BLAKE2b-256 c8b8c4e4c5d495d78494dddaa0c3da0581b81ce770f1ad439f27d4f447bd808b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c3e734e69f9c984355c64bdf872a0ca0cf9d15b3eaab3ff3d2364b26487232dd
MD5 d3c6e3d715b3d427e9ddc29daa76358d
BLAKE2b-256 9faad13d28148098ea267b7194c4f5535e9a10401730ffc4302c5b5f0a9930c2

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp27-cp27mu-manylinux1_i686.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 0b131aa2bb86cc1a8d2e3c1267668924d53f70d80c88fb25f2ff061a98a5c85e
MD5 a2553fe668c537d4376a527c70a3cb7e
BLAKE2b-256 d775d8f3c6c650eec5aafcb6d3ed990e07bb3be75292bae5ac3e4ed48b9dd358

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 e13ce8e6ea722957f3284d5741f8e9bf2437fd053eb1d8c3b5b4413c3f116481
MD5 c7a5e475daf2577d53379a63cb23f3cd
BLAKE2b-256 c1f7945a7fef808f4057caf72a2bcf405e30babd18d60ce2cae30dbbd9e4ce17

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 9dd47c932ef3ec68ef97f7daff0b7450acf20c15247ec4dfcc9d73ba989de172
MD5 64abf72c5fcc3a7132c0c14493b3d4a3
BLAKE2b-256 412b47cbcdd8c1a310ad7c97e5bdd5c307e09b99ced6c04bb63fe206584c504c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a0729a5d877aded07d663f671a97d3e3e73d5554d424361413254a84ff0fca24
MD5 abe5e02d3a961bc56037f1acd9d49d86
BLAKE2b-256 82ace1d27501ceb36fc5918e028a7e2d78cf71182d3642c3a484d72053dba095

See more details on using hashes here.

Provenance

File details

Details for the file grpcio_tools-1.0.3-cp27-cp27m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 fcb1afbec372e440b35706e287a11e0ecc9dab9520c7916e4cc30527eaaeb3d6
MD5 b1c226bf981dcb57c661819ec0af2db5
BLAKE2b-256 3c94cb4babed458a5cab55b2142cbdd82d01aa8357d857da617176a1c486d6c5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.3-cp27-cp27m-macosx_10_10_intel.whl
Algorithm Hash digest
SHA256 76cb581a7676a27eb5ce4051b8a13557a181f2451b955207b5d22f63c11c3e76
MD5 6885bc5271ce9a4099945729e0b8d00c
BLAKE2b-256 918f9d37c4c4955e8ce7613f1a1f48b276c12a12ebbdcec6a7ae5875de6b6c6a

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