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

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.13.1
    • 5.12.3, 5.13.0
    • PySide, Shiboken
    • None
    • Linux/X11
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ctismer Christian Tismer
            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