[ https://issues.apache.org/jira/browse/PHOENIX-6863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17681255#comment-17681255 ]
Istvan Toth edited comment on PHOENIX-6863 at 1/27/23 9:51 AM: --------------------------------------------------------------- This seems to happen only when using the "pure" python implementation. When using the "cpp" implementation, it works fine: On the problem system, I checked the implementation, and I got "python" {noformat} python -c 'from google.protobuf.internal import api_implementation; print(api_implementation.Type())' python{noformat} Then I installed the protobuf C library (from the distro repo), removed, and re-installed the python protobuf library {noformat} yum install protobuf pip uninstall protobuf pip install protobuf{noformat} The pip reinstall was necessary to cause the python protobuf to switch to the cpp implementation: {noformat} python -c 'from google.protobuf.internal import api_implementation; print(api_implementation.Type())' cpp {noformat} After this, the I was able to successfully import phoenixdb on the problem system. was (Author: stoty): This seems to happen only when using the "pure" python implementation. When using the "cpp" implementation, it works fine: On the problem system, I checked the implementation, and I got "python" {noformat} python -c 'from google.protobuf.internal import api_implementation; print(api_implementation.Type())' python{noformat} Then I installed the protobuf C library (from the distro repo), removed, and re-installed the python protobuf library {noformat} yum install protobuf pip uninstall protobuf pip install protobuf{noformat} The pip reinstall was necessary to cause the python protobuf to switch to the cpp implementation: {noformat} python -c 'from google.protobuf.internal import api_implementation; print(api_implementation.Type())' cpp {noformat} After this, the I was able to successfully impor phoenixdb on the problem system. > PhoenixDB 1.2+ doesn't work with Python2 on some systems > -------------------------------------------------------- > > Key: PHOENIX-6863 > URL: https://issues.apache.org/jira/browse/PHOENIX-6863 > Project: Phoenix > Issue Type: Bug > Components: python > Affects Versions: python-phoenixdb-1.2.1 > Reporter: Istvan Toth > Assignee: Istvan Toth > Priority: Major > > On some systems we hit a protobuf bug which causes the following error when > importing phoenixdb: > {noformat} > (env) [root@aglhue0124-1 ~]# python > Python 2.7.5 (default, Jul 13 2018, 13:06:57) > [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import phoenixdb > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File > "/opt/cloudera/parcels/CDH-7.2.17-1.cdh7.2.17.p0.36938352/lib/hue/build/env/lib/python2.7/site-packages/phoenixdb-1.2.1-py2.7.egg/phoenixdb/__init__.py", > line 19, in <module> > from phoenixdb import errors, types > File > "/opt/cloudera/parcels/CDH-7.2.17-1.cdh7.2.17.p0.36938352/lib/hue/build/env/lib/python2.7/site-packages/phoenixdb-1.2.1-py2.7.egg/phoenixdb/types.py", > line 21, in <module> > from phoenixdb.avatica.proto import common_pb2 > File > "/opt/cloudera/parcels/CDH-7.2.17-1.cdh7.2.17.p0.36938352/lib/hue/build/env/lib/python2.7/site-packages/phoenixdb-1.2.1-py2.7.egg/phoenixdb/avatica/__init__.py", > line 16, in <module> > from .client import AvaticaClient # noqa: F401 > File > "/opt/cloudera/parcels/CDH-7.2.17-1.cdh7.2.17.p0.36938352/lib/hue/build/env/lib/python2.7/site-packages/phoenixdb-1.2.1-py2.7.egg/phoenixdb/avatica/client.py", > line 27, in <module> > from phoenixdb.avatica.proto import common_pb2, requests_pb2, > responses_pb2 > File > "/opt/cloudera/parcels/CDH-7.2.17-1.cdh7.2.17.p0.36938352/lib/hue/build/env/lib/python2.7/site-packages/phoenixdb-1.2.1-py2.7.egg/phoenixdb/avatica/proto/common_pb2.py", > line 36, in <module> > _STATEMENTTYPE = DESCRIPTOR.enum_types_by_name['StatementType'] > AttributeError: 'NoneType' object has no attribute 'enum_types_by_name' > {noformat} > There are several error reports for this behaviour with the new using the > files generated by the new protoc with python2, but the fix is not available > in a version that is compatible with Python2. > We don't see this error when running our dockerized test suite with Python2. > We need to understand the issue, and figure out a solution. -- This message was sent by Atlassian Jira (v8.20.10#820010)