GithubHelp home page GithubHelp logo

Mac Invalid GUI about pressurecooker HOT 6 CLOSED

ivanistheone avatar ivanistheone commented on June 2, 2024
Mac Invalid GUI

from pressurecooker.

Comments (6)

ivanistheone avatar ivanistheone commented on June 2, 2024

@kollivier I'm not sure how this works, so could you please take a look?

from pressurecooker.

kollivier avatar kollivier commented on June 2, 2024

@ivanistheone Which python version are you using, and from which distro? (e.g. python.org installer, homebrew, Apple's python) I would guess it's a difference in how matplotlib is built, maybe because there were some libs missing that the ps backend needs?

from pressurecooker.

ivanistheone avatar ivanistheone commented on June 2, 2024

I'm on Python 3.6.5 installed via homebrew. Is there one of the other backends that is likely to be available on win/linux/mac?

I thought this might be a problem specific to Jupyter so I tried running this:
%matplotlib inline in the notebook first, which downgrades the problem to a WARN

screen shot 2018-05-17 at 1 50 29 pm

So it's clearly something to do with the way I'm using (interactive console rather than script). Trying the same import in a non-GUI ipython also fails, but for a different reason:

(venv) ivan@probook ~/P/F/sushi-chef-pradigi> ipython
Python 3.6.5 (default, Mar 30 2018, 06:41:53)

Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from pressurecooker import images
---------------------------------------------------------------------------
UnknownBackend                            Traceback (most recent call last)

<ipython-input-1-6c826759be6b> in <module>()
----> 1 from pressurecooker import images

~/Projects/FLECode/sushi-chef-pradigi/venv/lib/python3.6/site-packages/pressurecooker/images.py in <module>()
     14     matplotlib.use('PS')
     15
---> 16 import matplotlib.pyplot as plt
     17 from matplotlib.figure import Figure
     18 from matplotlib.colors import LinearSegmentedColormap

~/Projects/FLECode/sushi-chef-pradigi/venv/lib/python3.6/site-packages/matplotlib/pyplot.py in <module>()
   2533 # are no-ops and the registered function respect `mpl.is_interactive()`
   2534 # to determine if they should trigger a draw.
-> 2535 install_repl_displayhook()
   2536
   2537 ################# REMAINING CONTENT GENERATED BY boilerplate.py ##############

~/Projects/FLECode/sushi-chef-pradigi/venv/lib/python3.6/site-packages/matplotlib/pyplot.py in install_repl_displayhook()
    164             ipython_gui_name = backend2gui.get(get_backend())
    165             if ipython_gui_name:
--> 166                 ip.enable_gui(ipython_gui_name)
    167         else:
    168             _INSTALL_FIG_OBSERVER = True

~/Projects/FLECode/sushi-chef-pradigi/venv/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py in enable_gui(self, gui)
    504         if gui:
    505             self.active_eventloop, self._inputhook =\
--> 506                 get_inputhook_name_and_func(gui)
    507         else:
    508             self.active_eventloop = self._inputhook = None

~/Projects/FLECode/sushi-chef-pradigi/venv/lib/python3.6/site-packages/IPython/terminal/pt_inputhooks/__init__.py in get_inputhook_name_and_func(gui)
     36
     37     if gui not in backends:
---> 38         raise UnknownBackend(gui)
     39
     40     if gui in aliases:

UnknownBackend: No event loop integration for 'ps'. Supported event loops are: qt, qt4, qt5, gtk, gtk2, gtk3, tk, wx, pyglet, glut, osx

from pressurecooker.

kollivier avatar kollivier commented on June 2, 2024

Ahh, okay, I bet that in those environments a backend like notebook gets set instead, and we are overriding that in the import. Let me try adding a check first to see if the backend is osx, which is the one that doesn't work, and only setting it in that case. Another way of handling this would be to move the code into Studio and ricecooker, so that the 'app' is setting the backend rather than the library itself.

from pressurecooker.

ivanistheone avatar ivanistheone commented on June 2, 2024

Anyway, probably not too urgent to fix, but it's a problem since I do a lot of the chef work in jupyter so would be good to figure out a way to tell mpl to chill out and not ask for a GUI, or an event loop for interactive figure interactions.

from pressurecooker.

kollivier avatar kollivier commented on June 2, 2024

I sent a PR with a potential fix, if that doesn't work we'll probably need to move the backend setting to the libraries that use pressurecooker instead...

from pressurecooker.

Related Issues (12)

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.