Skip to main content

UNKNOWN

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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

grpcio_tools-1.1.0-cp35-cp35m-manylinux1_x86_64.whl (19.3 MB view details)

Uploaded CPython 3.5m

grpcio_tools-1.1.0-cp35-cp35m-manylinux1_i686.whl (18.5 MB view details)

Uploaded CPython 3.5m

grpcio_tools-1.1.0-cp35-cp35m-macosx_10_9_intel.whl (3.2 MB view details)

Uploaded CPython 3.5m macOS 10.9+ intel

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

grpcio_tools-1.1.0-cp34-cp34m-manylinux1_x86_64.whl (19.3 MB view details)

Uploaded CPython 3.4m

grpcio_tools-1.1.0-cp34-cp34m-manylinux1_i686.whl (18.5 MB view details)

Uploaded CPython 3.4m

grpcio_tools-1.1.0-cp34-cp34m-macosx_10_9_intel.whl (3.2 MB view details)

Uploaded CPython 3.4m macOS 10.9+ intel

grpcio_tools-1.1.0-cp27-cp27mu-manylinux1_x86_64.whl (19.3 MB view details)

Uploaded CPython 2.7mu

grpcio_tools-1.1.0-cp27-cp27mu-manylinux1_i686.whl (18.5 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

grpcio_tools-1.1.0-cp27-cp27m-manylinux1_x86_64.whl (19.3 MB view details)

Uploaded CPython 2.7m

grpcio_tools-1.1.0-cp27-cp27m-manylinux1_i686.whl (18.5 MB view details)

Uploaded CPython 2.7m

grpcio_tools-1.1.0-cp27-cp27m-macosx_10_10_intel.whl (2.9 MB view details)

Uploaded CPython 2.7m macOS 10.10+ intel

File details

Details for the file grpcio-tools-1.1.0.tar.gz.

File metadata

File hashes

Hashes for grpcio-tools-1.1.0.tar.gz
Algorithm Hash digest
SHA256 fea958fb062457a52d726e6489fc6070525c11bf180dd19b080d07c403cf531d
MD5 8bf27dcb647cec1958df57622d00552b
BLAKE2b-256 3b2f660b97b8e282250eca1907a3a5c9040c744b661e78c7880da7b52ec79b56

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 e42ca9240e7509a0327b5def882d63e1df59f68215810c54ab6266cfa37ccf92
MD5 4c6acfd24244d5bc5978b482d8adf502
BLAKE2b-256 fd3b800e5ba598dcd2ccc2a330bf198b3562bb8163e0079d0ab6ddf72d6c5f54

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 aea851599c902b86b0360f9955b899ff69dcc9ada57dd71b0f53179826d4fe96
MD5 1364e3d37f39a6d9a583c9fca678bb15
BLAKE2b-256 6fb4cbf1807f557d636042f2d66e6b39a42045c2ea1de3bca6f959de78e4d32b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 570762704059fda5c28571b02f2865bcba4002c1214b170603bfe2a35ec5edc5
MD5 9110241b0be9aca5301e0f12b7ac4aa8
BLAKE2b-256 e685d63070dab8728c88bf65aff155dc30566250cfb9d08ec87fe778b6f231e3

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 142ff09a6c5364daaaad33492d1f5f73c1bf13079c7b12fd1c859a685faa76ca
MD5 bb9219161b6b21054bb0e319d0e9a731
BLAKE2b-256 d26c96ab26d9bfee218460bd39cb27768ee939fd64c823c03d2b6080a0ba9762

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp35-cp35m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 2221befb0c7f609f2bea791b2c4238c905f65fe52aa453caa681498983d5cb0b
MD5 4c204fef97246debb0c73332f5803a81
BLAKE2b-256 f9b9cc2e679a820ce3459c720596dc6f4be59191658d4a4152733dc40aeea844

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 499cf717c4a37053d5ec3ba26489883880c8175d37cae241d733c741872f3c00
MD5 f72da3a8b1092f5b0a192c866eb7fb19
BLAKE2b-256 78861e5df3ce134fe62a4978ec59201120a21ae010c7ff1ef0a05bcfba3ecb2e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 2ee200de9c16da29c9df701dce55d96ea95a95d1b084450c18df5292ec71b9e1
MD5 7a6340c7e015c3cc04bfdb242b799e30
BLAKE2b-256 51d1b1f2faee889d82f24e96398c6a3be91e56b7b98f4a0b5ac170a5c123ebd6

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 43e4a839ddcd66673a2ce752b207d12842c706cc8dac30db637ff064df2b5ba4
MD5 20db42bd39c5da5c6ce068810a5f893a
BLAKE2b-256 8f3439fb6e8129ad7c58520be4991028186830f2b6ef5b7a8f4eef02cd2606b1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 b59dbf1401d439ed9e97893e6751a6ec10e5a3e3484670d642ba474ed4a115de
MD5 4adec09c5d9a7263281ed02d03c6a6f9
BLAKE2b-256 d25dcbce6552926eaea3824512132068c1b916a3afd9d4ad3b85c0877973baed

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp34-cp34m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 2c087b38ea15d663dd8c73890ffde68084bec1ae80548c3a05275fd5252be6eb
MD5 4a8bf0a68afaf0382130e064260113d4
BLAKE2b-256 6d35e7e8b2bb326fe8e7d7ba71091bb20273c598b148713255b0dddf44b56fb5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ae0d7308fe31996b203021f34c53f17d02efd323936ccf230c282e4a9095b134
MD5 63f122c183d528328ace94ccf7540e25
BLAKE2b-256 cb34c29217d22eb238394230245888721186d08df3ccd3cfdf2c7293ed9ea00e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 451f5990e839e68888df5a893efd63e3bd5aab4acfa19dfe98e6c5fef70b41e0
MD5 87f60d17954636a432670eacd85202b8
BLAKE2b-256 970515a87a510101ab24bc1b7fa1570463220ef4b7a27c449e6fdafa5639bc77

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 b75d4b44402a57fcd3b405df8ba826783f915e6869e59fc7c66d58bf45d201fe
MD5 dc6e1a20a6e0cde83b1e229a0a24dc68
BLAKE2b-256 b1e85eb2dc4dbf58460b696fdbc2ed90c4a3b3407d96c569fd00609bad9d6959

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 9cfd35db5e11f80a4c68de880a89fc498bc7e2a87e8024a6aab40966179a560a
MD5 f6d29e27e427af4babfc00beb9ced04f
BLAKE2b-256 60cbb15658e988c2424ef080de17288f0c822335557fd686e8a88f3e7ff393fb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a4fb69627881808f50a3fc913b67e272c5a1625760914cb9cf5dcf1ed9c79e54
MD5 bf34e07d8538c538c954894aeb3b5d9e
BLAKE2b-256 7ce58d873e730ab92bdd8c2c23e66e9f12b201f5af7c93769e725cdb44fcb34d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f64e98184298981e0c870c3193b6fea8d7f7c13008c18061200ac27c65521020
MD5 511c8cc0b29a0e0a9162273da34428d4
BLAKE2b-256 8211827fac021abe148d651bfdec0e5e445d5b355d6233b2272b0b9d26d3642c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.1.0-cp27-cp27m-macosx_10_10_intel.whl
Algorithm Hash digest
SHA256 c572e9855781976d9a3ffa940407e584e020895f5df70a62141047879b380dbb
MD5 23b4a2311a710b3eff4114a5402e4f43
BLAKE2b-256 e8aff2d9e200a075044130664c3b4a346142fb5e6a497a26890c0b1c776dcd77

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