Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1073

Maximum recursion depth exceeded when using matplotlib with pyside2 API and typing module in python 2.7

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.12.3, 5.13.0
    • Fix Version/s: 5.13.1
    • Component/s: PySide, Shiboken
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      28958dfae22cc6e52dfb71c4b00c20aba72531a1 (pyside/pyside-setup/5.13)

      Description

      When using python 2 (2.7.15) and PySide2 5.12.3 or 5.13.0, and I have an "import typing" in the code, I get a RuntimeError due to a "maximum recursion depth exceeded" when using matplotlib (3.0.3, with Qt5Agg and pyside2 API).

      Here is a minimum example which gives me the error (seeĀ error.txt):

      import os
      import typing
      import matplotlib
      matplotlib.use("Qt5Agg")
      os.environ["QT_API"] = "pyside2"
      import matplotlib.pyplot as plt
      fig = plt.figure()
      ax = fig.add_axes([0, 0, 1, 1])
      

      The RuntimeError disappears if I comment either "import typing" or 'os.environ["QT_API"] = "pyside2"', so I suppose there is a clash between typing and pyside2 (the typing27 module in shiboken2?)...only in python2. No problems with python3...

        Attachments

        1. error.txt
          72 kB
          Stefano Gariazzo
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              ctismer Christian Tismer
              Reporter:
              steog88 Stefano Gariazzo
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes