Merge pull request #23437 from lidizheng/update-support-message

Update the hint for install Python header to depend on version
pull/23468/head
Lidi Zheng 5 years ago committed by GitHub
commit 6ff6066dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      src/python/grpcio/support.py

@ -28,18 +28,25 @@ int main(int argc, char **argv) { return 0; }
"""
C_PYTHON_DEV_ERROR_MESSAGE = """
Could not find <Python.h>. This could mean the following:
* You're on Ubuntu and haven't run `apt-get install python-dev`.
* You're on RHEL/Fedora and haven't run `yum install python-devel` or
`dnf install python-devel` (make sure you also have redhat-rpm-config
* You're on Ubuntu and haven't run `apt-get install <PY_REPR>-dev`.
* You're on RHEL/Fedora and haven't run `yum install <PY_REPR>-devel` or
`dnf install <PY_REPR>-devel` (make sure you also have redhat-rpm-config
installed)
* You're on Mac OS X and the usual Python framework was somehow corrupted
(check your environment variables or try re-installing?)
* You're on Windows and your Python installation was somehow corrupted
(check your environment variables or try re-installing?)
"""
if sys.version_info[0] == 2:
PYTHON_REPRESENTATION = 'python'
elif sys.version_info[0] == 3:
PYTHON_REPRESENTATION = 'python3'
else:
raise NotImplementedError('Unsupported Python version: %s' % sys.version)
C_CHECKS = {
C_PYTHON_DEV: C_PYTHON_DEV_ERROR_MESSAGE,
C_PYTHON_DEV:
C_PYTHON_DEV_ERROR_MESSAGE.replace('<PY_REPR>', PYTHON_REPRESENTATION),
}

Loading…
Cancel
Save