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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m macOS 10.9+ intel

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

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

Uploaded CPython 3.4m

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

Uploaded CPython 3.4m

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

Uploaded CPython 3.4m macOS 10.9+ intel

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

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

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7273628fd2623381fb300f557a80de9b1052253d9d225ef576e80f092950ac7d
MD5 9b10fcc35253e16f99e8ed909879f809
BLAKE2b-256 51e7ee3448f6c0bef6758dc9d9db6282aab6504761bd243a23b32c0e450494a7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 9d03ec50a729ec280ec8859409487265e7801062ef3b277d0f6a1de4d1e6f609
MD5 bcdd2c969787ff9f55a5bd7c2df028f8
BLAKE2b-256 1acef120a05f00d32a45b489f0ec2283234ff63f6b69fd6b6f0938cd39a8f7d7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 194663f5f0d70db30a0c7f40c1d9d027cb26621049dfac629430a6138432701c
MD5 baf86878c190de43f423442bfe92dd20
BLAKE2b-256 8778bbf076aac5aae98e8dc4cb42526428829fb2f672b0d5a71f854cad5de2e7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 39cf02c7cceeffecf6a6d4839bc5fc255828015a31ea88855eb3650998e51867
MD5 f592a118a04c0edb61f4b67086805826
BLAKE2b-256 1610c7efc22f8c3a9f3002f996c63dee10efdebe36fc2660dceb9599203767f3

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f9e9fb0ffc8bd089c8138c89d9f9f564b92708761a78f63d462575f7a2b758c2
MD5 2769af33dacbd68d0aad9be66eca87ad
BLAKE2b-256 f3aba7e8d0dfbf801cfceb33c32aa934916fa83f9cf909e280129dcc5787cac4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp35-cp35m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 b3bc64e670ab18a970bc2b90b261c12192dd51ba2efff509421949f1e18d7555
MD5 001452de62f272a4e72b5b614ac7e520
BLAKE2b-256 29606bd7cdcc511101b40b4928dc0076ac87a67ebc1002ff08e22976f2a407b7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 fd3e5f1ab2a653fc01370996fca897f1737d1f727b07b6ca25c652649b617481
MD5 afb4754cea7c4c1d1630ced177344256
BLAKE2b-256 0326c49b3391b23a71daa33e56cdc8f61a3953e5e1dee792f05d113411c70c0e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 83bead94243f2d4d57cf1a6ff8eb37187033985c0b9f708a28432fb39fe69fbf
MD5 6c0f448e470aacd93c2ebd7dafa52c8f
BLAKE2b-256 ebc9ebb6cf8989003f47c21e5f0e1e1c6c357114164845e12ddcb29ec49dd921

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 83bd46d38600fa3575a78e64fdff50adb3c2783af49c39fb0bd9b07e446da5f2
MD5 5d0d7750ef7f6564cf70ffc70f5bd4dc
BLAKE2b-256 c2525ca72088708bad7900acd748d921d9ca58160241484597c1e9f446d48d3e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 a94ca2d6eb4d71e72abde5285a7153d8b755f545e75a9d7a79c4e426ecdcda06
MD5 9d789afbf63d38effc4257479f3cfa4f
BLAKE2b-256 7ee0e12efcd31f53365292c4d345a7daeff4ee6a2382b58d07f632ebb7668e61

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp34-cp34m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 e856b580b142cd455535b78fc7a3b00394937b395f61fcd1b1a1848f73fb8c5f
MD5 cb6199a5fae1f591cfa04cecbee5f3af
BLAKE2b-256 d6a78b98ef6cc98bfc0462984c26394f8d05cdc778bfb92fe9947dd529022f5a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 877bce6fe530de656ef7294187f7962f0f4b4218b1bf69573419deb7a8ab89c1
MD5 843f682e8497bdaf2d1352011a0f3dc1
BLAKE2b-256 79a780d5962de968d6b29b408629dfb94c80d26eefd70c26157b886155b202c3

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 635628dace81c52aa3b79d1e0d61511277a3f864dcaaa8271723c1fb0d9d44d4
MD5 ea16924eb848e6b0f12f1dff409db4c9
BLAKE2b-256 8cd65728bb55d12fd37aba7718de2ba9975042f9fcf1924c0d769a4bf190dde1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 41c1b5d12717cded8dbf6f2817156208f5fca8bc308dab30f55d532da7aaedb5
MD5 9f5ed8384b9620023c514f4f0f56d9a6
BLAKE2b-256 9737f452942c433737c4a543047f41c1e9f769c4296ffedf44b1154e591ba3bd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 e753b7ee1dbae54ba95d25169d225814c2ac2958d35fa7cb779f63c7d4a0ef7c
MD5 ea8760b73c907c832463a6b30472bf6c
BLAKE2b-256 3748917a898539acce226ac35f1fb76aef6027437deda3536399747828b31043

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c98ad83058472a3701a4708bd976a34a5b9f7012587b2f6c5b4de73d71f97d39
MD5 a7e69773c27bc3c881bebccc89a2e3bb
BLAKE2b-256 cdccbf3fa16185fbde00d40d295f80230d66784b6fe069befd11fd83123766e4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 7806600ef67e7aebe67423ec5c05b8175da56f1ac3b172883d7332b4b199cead
MD5 f373897a28bd0726fdd67510f1ec73c6
BLAKE2b-256 fd4f9035d0eada3b108ad8d91fe30cd26724407858531d9b44f984fd07111e93

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.0-cp27-cp27m-macosx_10_10_intel.whl
Algorithm Hash digest
SHA256 06bdb0d78c578bb360da266d55f2727518e6ecf1ef09972e034f1ef7b3e6fb79
MD5 914cedb9747bce3e1fe25676d5dd08b2
BLAKE2b-256 0e593f8b1f60ece6ad377e65c85ee9ac6dc40358fa67998aa9b08e8a65d44f1a

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