grpc: grpcio-tools: ImportError: No module named 'Cython'

$ pip install grpcio-tools
Collecting grpcio-tools
  Using cached grpcio_tools-0.15.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-l75jpu4j/grpcio-tools/setup.py", line 113, in <module>
        protoc_ext_module(),
      File "/tmp/pip-build-l75jpu4j/grpcio-tools/setup.py", line 105, in maybe_cythonize
        from Cython import Build
    ImportError: No module named 'Cython'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-l75jpu4j/grpcio-tools/
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I think it’s cython. Just installed python plugin from source.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (11 by maintainers)

Most upvoted comments

What happens if you pip install --upgrade cython when you see the problem?

@mjhoffman65 Looks like Python 3.6 is officially released, I’ve created #9445, hopefully I can get support in for the next release.

Im still running into this problem when trying to have grpcio-tools as part of setup_requires in the setup.py. I noticed that grpcio-health-checking also tries to get grpcio-tools by setup_requires so in a venv i tried to python -m pip install grpcio-health-checking and that comes up with the ‘No module named Cython’ error also.

Even if i try to pip install Cython in the venv and try again, i get distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27. Though this might be separate problems