Skip to content

Instantly share code, notes, and snippets.

@jabooth
Created February 2, 2014 15:37
Show Gist options
  • Save jabooth/8770104 to your computer and use it in GitHub Desktop.
Save jabooth/8770104 to your computer and use it in GitHub Desktop.
OS X %matplotlib qt bug
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": "",
"signature": "sha256:c7d68564f2b2fff600fcf2261eb5ec775f4f9271df073c5e69c6b97e8ef0c97d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Running the following cell immediately doesn't behave as expected."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%matplotlib qt\n",
"from mayavi import mlab\n",
"mlab.points3d(1, 1, 1)\n",
"# if run first, cell never stops executing\n",
"# manually killing the spawned process in the dock\n",
"# causes the cell to return"
],
"language": "python",
"metadata": {},
"outputs": [],
"trusted": true
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Restart the kernel. Now try this instead"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%matplotlib qt # returns fine!"
],
"language": "python",
"metadata": {},
"outputs": [],
"trusted": true
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from mayavi import mlab\n",
"mlab.points3d(1, 1, 1)\n",
"# behaves as exepected.\n",
"# can interact with the mlab view\n",
"# and this cell returns"
],
"language": "python",
"metadata": {},
"outputs": [],
"trusted": true
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that this is run after `ipython notebook` on `OS X 10.9.1`. The following environment variables have been set: \n",
"\n",
" QT_API=pyqt\n",
" ETS_TOOLKIT=qt4\n",
" \n",
"Using IPython master, SHA: `9b8c058d4ef1667b292fea5e5a365aa545da6112`\n",
"\n",
"`pip list` shows:\n",
"\n",
" matplotlib (1.4.x)\n",
" VTK (5.10.1)\n",
" mayavi (4.3.0)"
]
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment