Title: Incompatible with CPP protobuf implementation for Python · Issue #2971 · googleapis/google-cloud-python · GitHub
Open Graph Title: Incompatible with CPP protobuf implementation for Python · Issue #2971 · googleapis/google-cloud-python
X Title: Incompatible with CPP protobuf implementation for Python · Issue #2971 · googleapis/google-cloud-python
Description: Hello, I'm trying to use C++ protobuf implementation for Python since pure Python proto is too slow. But importing gcloud.bigtable package throws an exception TypeError: Descriptors should not be created directly, but only retrieved from...
Open Graph Description: Hello, I'm trying to use C++ protobuf implementation for Python since pure Python proto is too slow. But importing gcloud.bigtable package throws an exception TypeError: Descriptors should not be c...
X Description: Hello, I'm trying to use C++ protobuf implementation for Python since pure Python proto is too slow. But importing gcloud.bigtable package throws an exception TypeError: Descriptors should not ...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/2971
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incompatible with CPP protobuf implementation for Python","articleBody":"Hello,\r\n\r\nI'm trying to use [C++ protobuf implementation for Python](https://github.com/google/protobuf/tree/master/python) since pure Python proto is too slow.\r\nBut importing `gcloud.bigtable` package throws an exception `TypeError: Descriptors should not be created directly, but only retrieved from their parent.`.\r\n\r\nIs there any way to fix this problem?\r\n\r\nThanks,\r\n\r\n1. OS type and version\r\nTested on ubuntu 14.04 / osx 10.12.\r\n\r\n2. Python version and virtual environment information `python --version`\r\nPython 2.7.6\r\n\r\n3. google-cloud-python version `pip show google-cloud`, `pip show google-\u003cservice\u003e` or `pip freeze`\r\ngoogle-cloud 0.22.0 / 0.18.3\r\n\r\n4. Stacktrace if available\r\n```\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/home/jungho.ahn/pyproto/protobuf/xx/local/lib/python2.7/site-packages/google/cloud/bigtable/__init__.py\", line 18, in \u003cmodule\u003e\r\n from google.cloud.bigtable.client import Client\r\n File \"/home/jungho.ahn/pyproto/protobuf/xx/local/lib/python2.7/site-packages/google/cloud/bigtable/client.py\", line 33, in \u003cmodule\u003e\r\n from google.longrunning import operations_grpc\r\n File \"/home/jungho.ahn/pyproto/protobuf/xx/local/lib/python2.7/site-packages/google/longrunning/operations_grpc.py\", line 47, in \u003cmodule\u003e\r\n options=None),\r\n File \"/home/jungho.ahn/pyproto/protobuf/python/google/protobuf/descriptor.py\", line 494, in __new__\r\n _message.Message._CheckCalledFromGeneratedFile()\r\nTypeError: Descriptors should not be created directly, but only retrieved from their parent.\r\n```\r\n\r\n5. Steps to reproduce\r\n\r\n```\r\n// Install CPP proto implementation.\r\n$ git clone https://github.com/google/protobuf.git\r\n$ cd protobuf\r\n$ ./autogen.sh\r\n$ CXXFLAGS=\"-fPIC -g -O2\" ./configure\r\n$ make -j12\r\n$ export PROTOC=$PWD/src/protoc\r\n$ cd python\r\n$ python setup.py bdist_wheel --cpp_implementation --compile_static_extension\r\n$ pip uninstall protobuf\r\n$ pip install dist/\u003cwheel file name\u003e (e.g., protobuf-3.2.0-cp27-cp27mu-linux_x86_64.whl)\r\n\r\n// Enable CPP proto implementation.\r\n$ export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp\r\n$ python -c 'from gcloud import bigtable'\r\n```\r\n\r\n6. Code example\r\n`from gcloud import bigtable`","author":{"url":"https://github.com/junghoahnsc","@type":"Person","name":"junghoahnsc"},"datePublished":"2017-01-28T18:27:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/2971/google-cloud-python/issues/2971"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:69ec00de-256c-1408-2c82-9efc0769af1b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA4E:3C3A87:AEEC56:F023A1:6A4D51B6 |
| html-safe-nonce | 71c7166934223ff4712239986741a6c067ff1e0b9871ab11e444919dae909260 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTRFOjNDM0E4NzpBRUVDNTY6RjAyM0ExOjZBNEQ1MUI2IiwidmlzaXRvcl9pZCI6IjU1MTA5MTUyMzk4NDU5MDg5MTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 20bd3f801654013675dda1bb2814b1d8eab4992c1b7181d1afdbc9e899e39d1f |
| hovercard-subject-tag | issue:203822653 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/2971/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c5e281317123157b4ce7083542bd00160194844eb77224bb2c4448bc363c0b53/googleapis/google-cloud-python/issues/2971 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c5e281317123157b4ce7083542bd00160194844eb77224bb2c4448bc363c0b53/googleapis/google-cloud-python/issues/2971 |
| og:image:alt | Hello, I'm trying to use C++ protobuf implementation for Python since pure Python proto is too slow. But importing gcloud.bigtable package throws an exception TypeError: Descriptors should not be c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | junghoahnsc |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width