Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4871

ZooKeeper python module (zkpython) is incompatible with Python 3.12

    XMLWordPrintableJSON

Details

    Description

      I've tried to  run zk-smoktest.py on latest Ubuntu 24.04 and with Python 3.12 and run into the following issue:

      $ python zk-smoketest.py -h
      Traceback (most recent call last):
        File "/home/andor/git/zk-smoketest/zk-smoketest.py", line 22, in <module>
          import zkclient
        File "/home/andor/git/zk-smoketest/zkclient.py", line 17, in <module>
          import zookeeper, time, threading
      ImportError: /usr/local/lib/python3.12/dist-packages/ZooKeeper-0.4-py3.12-linux-x86_64.egg/zookeeper.cpython-312-x86_64-linux-gnu.so: undefined symbol: PyIOBase_Type
      

      It turned out that PyIOBase_Type is deprecated and not available in Python 3.12.

      Found the following workaround in a different project which might be useful for zkpython too.

      https://github.com/inspired-solutions/pygraphviz/pull/1/files

       

      Attachments

        Issue Links

          Activity

            People

              andor Andor Molnar
              andor Andor Molnar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m