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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m macOS 10.9+ intel

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

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

Uploaded CPython 3.4m

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

Uploaded CPython 3.4m

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

Uploaded CPython 3.4m macOS 10.9+ intel

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

grpcio_tools-1.0.2-cp27-cp27m-manylinux1_x86_64.whl (18.5 MB view details)

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2.tar.gz
Algorithm Hash digest
SHA256 263163edca77692ad472e23e2155938e2c836a93d1755627690b371a2e262e96
MD5 11cefdecf5385cae10314d4f678568c9
BLAKE2b-256 f0fd4a23f653bce1cc696da5b0ac7b0a81249345ced47b14693c01dac56ef085

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 1b1fb18caf4fa690ae2810fb20fe5b1faaa402fabd94976cf31759601c493d93
MD5 e41cff9e561cc6177623b710bd27f6e7
BLAKE2b-256 7c9574563ae6415a9c7a2fa077202a1a3b13bac10259bfdbde8540e8af6c63fa

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 e7ed84c6e45155a1ebdb9e07e78de98a44f36e2a9db0b22c26dac19e6f901b57
MD5 cb86e4d6d83c009e7836542f8af3cc79
BLAKE2b-256 5a9ca1da41b022f61833872ca54c5dc3d59a6fe22a02bf7acecdb64728b97772

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f1a99998041c143ab68599dfd86c61d3d6eac39f6091a155f13c7dd69d23a26f
MD5 b1c1cef6dfa1d02a6196f59f4ffab0a1
BLAKE2b-256 b5e5e33783b60d9ea79ef3ea96640ac277558d7f8736a84e22dedd9576a05e5f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 2c4ac04f88aa3b798fe126e160d92d5ad0b25a24acf603f6750fb833b85644ce
MD5 d36b061053924d2f560a3a9cf0c0b4e6
BLAKE2b-256 a02d54c6178cb5cc652099dc7063bbed952fe128605d75555975a42b2f10d66c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp35-cp35m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 d83b6105f38c503d6e8000301e60cfb6d0025681353dacfdce1058ee460fd185
MD5 a4d85620b4eaf35cc338eafb3854cbb0
BLAKE2b-256 085ca345d1f2aa90172d500f8de4d17599c110df04ece371da955e6e9363d63f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 f774884d20ba7f75651eb1070a21bb9667888326b8dbed9310d5d4666d0be4c5
MD5 bc62f20d5ef0a48bb21497f5daa76075
BLAKE2b-256 04f2a981259398531f2236b7ce93e78260f88fa7b52b7374deeabe20b4b981f5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 d9439799556a3095e3686480a90c3147b244ed34a6f8b1ed08b04a656e8e3ef8
MD5 e8c8352d0e1298b01116909848bab7f8
BLAKE2b-256 5a3f1179a29884fbca6cc97da467ab5ecaee92f7c1a08f898b3dedabe9422fc9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e5afa45418f9b646be5889568ca9df481f62050886c5ccfdee8b9a48215929c4
MD5 fd10df3a1b87012a443893d932884c55
BLAKE2b-256 12c1fbd4e72f9760fcc0848d236c4eb96b950e403a9e776bddc6acb3a8c0c8c9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f6fbbfbdf0e6e5feca72a9b6910b610443049fddb69be836531d20055befa5ea
MD5 35d872203e7518d25e9d327f6b5aad35
BLAKE2b-256 c0b03cdfb0e7bbd39fba887be661d18320a686a651d9e7956360ebcfecbfac16

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp34-cp34m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 04d451f14506650159fbdd00233dff44f2e98374608692f34745b806b345f6e2
MD5 d5f563e047ac3fd1f536003e263a1662
BLAKE2b-256 5b9d4d8ec173b93e347006dfb168a198645c19f631b55608dfc7492cd9c74a95

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 59a199f884172b6e49766bde86a01b9515349a80bcdd7104092cb869eb50664c
MD5 dbe03592eb84ba811572d5ac57e7f1bf
BLAKE2b-256 37443ab1ae4faf5ca6b3cc89b521dee49473656a62614f81ee7c2aaa690b869d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 91e0731687a600223e6a9c3119d60396f57353f5e54313eab53f08e8b01a4488
MD5 cba9247146c77fda19a31951603f31eb
BLAKE2b-256 e34d36433a0d0aa05a473504ed4055a978470d4b82682f72547f33c22f0f3ec9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 2d9afaaa8bc96f95ac783a09753abf3b73bb1b10feff66c9fe3bba176bd54d54
MD5 c392a3072fcb10857b44bcee47abc240
BLAKE2b-256 68a4452dca5edf054a5483cd3b9833cbf0d0891419d9e7f03dc2f0c726d6baaf

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 e2a5bac62f618e471907479dd212a8998c5eaf4d941a63c7e61473356a36bb26
MD5 d313e6417f8711ee8d7f256b67ee6f30
BLAKE2b-256 74bf527892e4dea1482cc2ee037103ac06103d10adbdc5f2f9483c3f17803169

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fe35bdc1051734555910af84bb97879cf0a2ed95303753b8392d954e051871cb
MD5 0948ab77bc8cce05055557ee4662617b
BLAKE2b-256 44dea3e5224b986237ee6fa46a4190710d2bb6af656f12c230fa16e87cf8acbd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4d8502ad01e2e24db60ecbc75ab44d330965aebf854f66e0d9fb9f1d72e05641
MD5 a7c3c47419d4e9df2a63c86dd4684dc0
BLAKE2b-256 d2d687e76006a68a27ccae1dc10b911cf6fe53b673ddb619226e9847537301bb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.2-cp27-cp27m-macosx_10_10_intel.whl
Algorithm Hash digest
SHA256 6cee8c04185d8bb2dff1017819484a7834817ed2d4af682b55c8ea7765e21936
MD5 e121a56013b96d4818df3e2c816d84e2
BLAKE2b-256 fa364292b7bec50f0e119facf621dbe3ebedda23e2efd5b38726e75be4772615

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