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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m macOS 10.9+ intel

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

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

Uploaded CPython 3.4m

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

Uploaded CPython 3.4m

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

Uploaded CPython 3.4m macOS 10.9+ intel

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

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

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1.tar.gz
Algorithm Hash digest
SHA256 783a037420f08085e4f048796e565ef93310f666462381b266de652d1a282d55
MD5 09802d1057eab8497e39798978fe4a2d
BLAKE2b-256 165d4ffbc603d26cf0a82549d3b11f00d94f5b1c897629d94824b8af01da9c72

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 9d74054baa3258287d31e3a09c697041773dbe0a5bd768c226e57489ecbd9617
MD5 7b3b95f49e99db945c86cdef0cddf495
BLAKE2b-256 e9076e388db8bf268e435b737c88f5d9e41e32eda25c59ee64a0d3bffdf9ec3f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 08deca4cff0db01dbae48d73036f692a3038e37913ceae8738558430711fb110
MD5 12097a916fbefa10498ee0fc3171a77e
BLAKE2b-256 c3daa54b3b3f0c28bf4bdf5ab4ed002c809fc94454c1e326cbc340967aaf476d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d5694507f97fe72b31f2a1f73912fe2a374f9b89f72c0d9fc47134d415ae7522
MD5 cd6ad6ef456770d17b0ac153f9078a7a
BLAKE2b-256 cf0a01e298dd3e718766f66ea451227f420691ace35834ba2fb2995a7ca210f7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 566c0dcd66a0a935c7c0d03ed78467192567674c42f4f89c9fc4e2fa22dd0340
MD5 99e807e0479a6c5d24255404547ad570
BLAKE2b-256 1f1c538082eeb4f87acdc71d6296d95c4c45ac0a815d3c3999f6133c93d10d3d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp35-cp35m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 b61a3a7e86f544b2886d6db28d45f67ad23e455fe2fd7c9bd5d9aa0fd91155cd
MD5 8efcef470d814bd8dd56be6109f4b1c8
BLAKE2b-256 51bec431b72cffd3045ab180c65cb5a277efadafabaf32dc87aec9a76e086b79

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 40fc6ecb97e3906b07131f5e0d95eabcba93f910f31ce98aff958c5a9864459e
MD5 33da4ce38c97f9b426f6584aa4603905
BLAKE2b-256 de862ac38cec034fff6f315a37c19550b0ad8fe5a68dc35ab83644c48e98a869

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 0fb56be4bb5aede48f76f8dc34edb870ecc5a0338c3c3537cb93a5943df59b87
MD5 1370b6ea4c84b3a7415b5cfeb577c910
BLAKE2b-256 7024e1647aecf120d9caedacfe26ffc1f59891ab1b4b618dd9f8f9f498a4390d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f5f75fa94175235366f725bed406f4bdbd483097d6bc4c3f3c816bee73aa8228
MD5 7dfa76ad3febbc1727091159b3128159
BLAKE2b-256 0823d325c02f61b32d1e5bbb2d20dd4d635ac378d98e0107b1e3f521d2caadd0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 c3ad6943371197394d22d16a47c57055025b04f7cb3ed1abb7e407c10aed87c0
MD5 86f7f8c38edf051795cfd8f25dc42f21
BLAKE2b-256 00c62320bde482335fc8761cfc5a666fe8f42edb048f6da253ee3f9a584e3a02

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp34-cp34m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 b6f7563716027af5462d4081996ace51f9abbe370a8cc2d5d71580198c8a1f3e
MD5 00a139f031e0ba20502bf2cd86e01a36
BLAKE2b-256 0e9ceda568aaba6008d5ffdd4316c9c200eaf6c631e9f7c536df1b68175051c5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ee92279ac1438583457cf943248b598840beba584a33d370e56d96d540703896
MD5 1d8ef023966a167139da837c6dfcae4a
BLAKE2b-256 ebaebf896ef21f75f370f31d0c079f2734cb374b007dbd788f1f4e81c807c555

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 c0dc156b7df87b097710efbe7ec51f9397be5c53b154a0bf95acc4b8c711d613
MD5 05db05f388ddb000b70cdf968c77b6a6
BLAKE2b-256 b9cabe182be62cf0606997fcebc2139565d9f0d195a878f7a2a90ca307baa738

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 75f8bb5bab72afd803f916b0e369373774472f5657d8c51ce5334dda3d8b12e3
MD5 b81111b757bb8174b6b2ff76e8eb7336
BLAKE2b-256 9fae88feaedaa0c6500646e1e9128adbd4e73764140a1644211ac59ff7cb5181

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 0b90003cdbce5cab942cbfdc290bd7b4d10469c1b29c84987e45a46ca0b55689
MD5 8ff8886a8b7fa82b1a6b877857317acd
BLAKE2b-256 ac50eb30cb3ce9c73bf569a27fd7da349e641b8d4cd26b1248f062a352d9f6e2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ef144d8b1ce9f48aa64475b93211eb2b724b9795ea13143783154517f7f4ea53
MD5 4d750555b5535aeadc4a99896a630bd9
BLAKE2b-256 eee0b6ef4910bc1e45b5aa878e564cc3047d039523f67cbd0693c4214b89aecd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 e874a7213a63ed48e902e34474e87b4fb73bfdba19aeecf9d367357e7c3301ae
MD5 d18b232c18915ca011c898159b5554af
BLAKE2b-256 d6f1868b6947d92f46f166144ac3081a967878e65e07cc2d63a788eb6a9b748a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for grpcio_tools-1.0.1-cp27-cp27m-macosx_10_10_intel.whl
Algorithm Hash digest
SHA256 3414e2d7ba754b7818ec0f5d375e75c55d8f2cf72c947dcecf63ce1a1e8269c2
MD5 54fac850aa04dbc525577e2a58769989
BLAKE2b-256 531219f45bb53ec4f123acff90754e48f93daebc5004bd818a98aa655e2ae7dd

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