Comments (6)
@kollivier I'm not sure how this works, so could you please take a look?
from pressurecooker.
@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.
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
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.
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.
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.
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)
- ffmpeg fails to encode some videos HOT 2
- Feature request: 16x9 aspect ratio thumbs HOT 1
- PDF Splitting HOT 4
- Convert srt subtitles to vtt format HOT 1
- Audio quality suffers during compression HOT 5
- Extract metadata from PDFs HOT 1
- srt2vtt dependecy webvtt-py is Py3.4+ only HOT 2
- Add Travis and tox.ini and setup automated testing HOT 1
- Subtitles formats and compatible youtube_language code checks HOT 1
- Conflicting versions of lxml HOT 4
- le-pycaption dependency: There are other active upstreams HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pressurecooker.