Giter Site home page Giter Site logo

ImportError: Cannot load backend 'MacOSX' which requires the 'macosx' interactive framework, as 'qt5' is currently running about pandasgui HOT 3 CLOSED

adamerose avatar adamerose commented on August 16, 2024
ImportError: Cannot load backend 'MacOSX' which requires the 'macosx' interactive framework, as 'qt5' is currently running

from pandasgui.

Comments (3)

adamerose avatar adamerose commented on August 16, 2024

@selasley I made it set the backend to Qt5Agg, let me know if that fixes it I don't have a Mac to test on. But this does add a side effect to importing pandasgui which is bad, so maybe there's a better solution

from pandasgui.

selasley avatar selasley commented on August 16, 2024

The problem appears to be associated with ipython. In a virtualenv with pandasgui 0.1.3 and ipython 7.5.0 this code

import pandas as pd
from pandasgui import show

example_df = pd.DataFrame(pd.np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]),
                          columns=['a', 'b', 'c'])
show(example_df)

works in when run as a script and in the python3 repl. It also works in a Jupyter notebook, but when run in the ipython3 7.5.0 repl the "'qt5' is currently running" error occurs. The code works in ipython3 if I set the backend to Qt5Agg before calling show(). I will try testing on a different Mac to see if this error is unique to my setup. If I am the only person seeing this error on a Mac, there is no need to have pandasgui set the backend.

Here is the tail of the error message starting from the last pandasgui call

...
~/pdgui/lib/python3.7/site-packages/pandasgui/widgets/image_viewer.py in __init__(self, fig)
     72         super().__init__()
     73 
---> 74         self.canvas = FigureCanvasQTAgg(fig)
     75         self.toolbar = NavigationToolbar2QT(self.canvas, self)
     76 

~/pdgui/lib/python3.7/site-packages/matplotlib/backends/backend_qt5agg.py in __init__(self, figure)
     19     def __init__(self, figure):
     20         # Must pass 'figure' as kwarg to Qt base class.
---> 21         super().__init__(figure=figure)
     22 
     23     def paintEvent(self, event):

~/pdgui/lib/python3.7/site-packages/matplotlib/backends/backend_qt5.py in __init__(self, figure)
    224     def __init__(self, figure):
    225         _create_qApp()
--> 226         super().__init__(figure=figure)
    227 
    228         self.figure = figure

~/pdgui/lib/python3.7/site-packages/matplotlib/backend_bases.py in __init__(self, figure)
   1580 
   1581     def __init__(self, figure):
-> 1582         self._fix_ipython_backend2gui()
   1583         self._is_idle_drawing = True
   1584         self._is_saving = False

~/pdgui/lib/python3.7/site-packages/matplotlib/backend_bases.py in _fix_ipython_backend2gui(cls)
   1627             try:
   1628                 mpl.rcParamsOrig["backend"] = mpl.rcParams["backend"]
-> 1629                 ip.enable_matplotlib()
   1630             finally:
   1631                 mpl.rcParamsOrig["backend"] = orig_origbackend

~/pdgui/lib/python3.7/site-packages/IPython/core/interactiveshell.py in enable_matplotlib(self, gui)
   3382                 gui, backend = pt.find_gui_and_backend(self.pylab_gui_select)
   3383 
-> 3384         pt.activate_matplotlib(backend)
   3385         pt.configure_inline_support(self, backend)
   3386 

~/pdgui/lib/python3.7/site-packages/IPython/core/pylabtools.py in activate_matplotlib(backend)
    312 
    313     import matplotlib.pyplot
--> 314     matplotlib.pyplot.switch_backend(backend)
    315 
    316     # This must be imported last in the matplotlib series, after

~/pdgui/lib/python3.7/site-packages/matplotlib/pyplot.py in switch_backend(newbackend)
    228                 "Cannot load backend {!r} which requires the {!r} interactive "
    229                 "framework, as {!r} is currently running".format(
--> 230                     newbackend, required_framework, current_framework))
    231 
    232     rcParams['backend'] = rcParamsDefault['backend'] = newbackend

ImportError: Cannot load backend 'MacOSX' which requires the 'macosx' interactive framework, as 'qt5' is currently running

from pandasgui.

adamerose avatar adamerose commented on August 16, 2024

Closing for now since code base has changed a lot since this and I still have no mac to test with. If anyone has the same problem again feel free to re-open or make a new issue.

from pandasgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.