Title: Problem with (documentation of?) QT gui and mayavi · Issue #10384 · ipython/ipython · GitHub
Open Graph Title: Problem with (documentation of?) QT gui and mayavi · Issue #10384 · ipython/ipython
X Title: Problem with (documentation of?) QT gui and mayavi · Issue #10384 · ipython/ipython
Description: I am trying to use Mayavi in IPython (terminal at the moment) and am running into issues that are surprising me in light of the documentation on this issue. Specifically, following this page: http://ipython.readthedocs.io/en/stable/inter...
Open Graph Description: I am trying to use Mayavi in IPython (terminal at the moment) and am running into issues that are surprising me in light of the documentation on this issue. Specifically, following this page: http:...
X Description: I am trying to use Mayavi in IPython (terminal at the moment) and am running into issues that are surprising me in light of the documentation on this issue. Specifically, following this page: http:...
Opengraph URL: https://github.com/ipython/ipython/issues/10384
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Problem with (documentation of?) QT gui and mayavi","articleBody":"I am trying to use Mayavi in IPython (terminal at the moment) and am running into issues that are surprising me in light of the documentation on this issue.\r\n\r\nSpecifically, following this page: http://ipython.readthedocs.io/en/stable/interactive/reference.html#pyqt-and-pyside\r\n\r\nI have done\r\n\r\n```bash\r\n[mlw-mbair ~]$ QT_API=pyqt ipython --gui qt\r\n```\r\n\r\nbut importing mayavi fails:\r\n\r\n```python\r\nIn [1]: from mayavi import mlab\r\n```\r\n```python-traceback\r\n---------------------------------------------------------------------------\r\nValueError Traceback (most recent call last)\r\n\u003cipython-input-1-3f0e4b94a8ea\u003e in \u003cmodule\u003e()\r\n----\u003e 1 from mayavi import mlab\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/mayavi/mlab.py in \u003cmodule\u003e()\r\n 25\r\n 26 # Mayavi imports\r\n---\u003e 27 from mayavi.tools.camera import view, roll, yaw, pitch, move\r\n 28 from mayavi.tools.figure import figure, clf, gcf, savefig, \\\r\n 29 draw, sync_camera, close, screenshot\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/mayavi/tools/camera.py in \u003cmodule\u003e()\r\n 23 # We can't use gcf, as it creates a circular import in camera management\r\n 24 # routines.\r\n---\u003e 25 from .engine_manager import get_engine\r\n 26\r\n 27\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/mayavi/tools/engine_manager.py in \u003cmodule\u003e()\r\n 10\r\n 11 # Local imports\r\n---\u003e 12 from mayavi.preferences.api import preference_manager\r\n 13 from mayavi.core.registry import registry\r\n 14 from mayavi.core.engine import Engine\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/mayavi/preferences/api.py in \u003cmodule\u003e()\r\n 2\r\n 3 # The global PreferenceManager instance\r\n----\u003e 4 from .preference_manager import preference_manager\r\n 5 from .bindings import set_scene_preferences, get_scene_preferences\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/mayavi/preferences/preference_manager.py in \u003cmodule\u003e()\r\n 27 from traits.etsconfig.api import ETSConfig\r\n 28 from traits.api import HasTraits, Instance\r\n---\u003e 29 from traitsui.api import View, Group, Item\r\n 30 from apptools.preferences.api import (ScopedPreferences, IPreferences,\r\n 31 PreferencesHelper)\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traitsui/api.py in \u003cmodule\u003e()\r\n 34\r\n 35 try:\r\n---\u003e 36 from .editors.api import ArrayEditor\r\n 37 except ImportError:\r\n 38 # ArrayEditor depends on numpy, so ignore if numpy is not present.\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traitsui/editors/__init__.py in \u003cmodule\u003e()\r\n 21\r\n 22 try:\r\n---\u003e 23 from .api import ArrayEditor\r\n 24 except ImportError:\r\n 25 pass\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traitsui/editors/api.py in \u003cmodule\u003e()\r\n 22 from .button_editor import ButtonEditor\r\n 23 from .check_list_editor import CheckListEditor\r\n---\u003e 24 from .code_editor import CodeEditor\r\n 25 from .color_editor import ColorEditor\r\n 26 from .compound_editor import CompoundEditor\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traitsui/editors/code_editor.py in \u003cmodule\u003e()\r\n 34 #-------------------------------------------------------------------------------\r\n 35\r\n---\u003e 36 class ToolkitEditorFactory ( EditorFactory ):\r\n 37 \"\"\" Editor factory for code editors.\r\n 38 \"\"\"\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traitsui/editors/code_editor.py in ToolkitEditorFactory()\r\n 46\r\n 47 # Background color for marking lines\r\n---\u003e 48 mark_color = Color( 0xECE9D8 )\r\n 49\r\n 50 # Object trait containing the currently selected line (optional)\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traits/traits.pyc in __call__(self, *args, **metadata)\r\n 520\r\n 521 def __call__ ( self, *args, **metadata ):\r\n--\u003e 522 return self.maker_function( *args, **metadata )\r\n 523\r\n 524 class TraitImportError ( TraitFactory ):\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traits/traits.pyc in Color(*args, **metadata)\r\n 1234 from traitsui.toolkit_traits import ColorTrait\r\n 1235\r\n-\u003e 1236 return ColorTrait( *args, **metadata )\r\n 1237\r\n 1238 Color = TraitFactory( Color )\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traitsui/toolkit_traits.pyc in ColorTrait(*args, **traits)\r\n 5\r\n 6 def ColorTrait ( *args, **traits ):\r\n----\u003e 7 return toolkit().color_trait( *args, **traits )\r\n 8\r\n 9 def RGBColorTrait ( *args, **traits ):\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traitsui/toolkit.pyc in toolkit(*toolkits)\r\n 159 try:\r\n 160 with provisional_toolkit(toolkit_name):\r\n--\u003e 161 _toolkit = _import_toolkit(toolkit_name)\r\n 162 return _toolkit\r\n 163 except (AttributeError, ImportError) as exc:\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traitsui/toolkit.pyc in _import_toolkit(name)\r\n 81\r\n 82 def _import_toolkit ( name ):\r\n---\u003e 83 return __import__( name, globals=globals(), level=1 ).toolkit\r\n 84\r\n 85\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/traitsui/qt4/__init__.py in \u003cmodule\u003e()\r\n 16 # import pyface.qt before anything else is done so the sipapi\r\n 17 # can be set correctly if needed\r\n---\u003e 18 import pyface.qt\r\n 19\r\n 20 #----------------------------------------------------------------------------\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/pyface/qt/__init__.py in \u003cmodule\u003e()\r\n 38\r\n 39 elif qt_api == 'pyqt':\r\n---\u003e 40 prepare_pyqt4()\r\n 41\r\n 42 elif qt_api != 'pyside':\r\n\r\n/Users/mwaskom/anaconda/lib/python2.7/site-packages/pyface/qt/__init__.py in prepare_pyqt4()\r\n 15 # Set PySide compatible APIs.\r\n 16 import sip\r\n---\u003e 17 sip.setapi('QDate', 2)\r\n 18 sip.setapi('QDateTime', 2)\r\n 19 sip.setapi('QString', 2)\r\n\r\nValueError: API 'QDate' has already been set to version 1\r\n```\r\n\r\nBased on the docs I thought `QT_API` would use PyQT API v2 and thus be compatible with mayavi.\r\n\r\nI am not, to my knowledge, importing anything else that would be setting the QT API ahead of time; i.e. my ipython startup file is pretty clean:\r\n\r\n```bash\r\n[mlw-mbair ~]$ grep '^\\w' ~/.ipython/profile_default/ipython_config.py\r\nc = get_config()\r\nc.TerminalIPythonApp.display_banner = False\r\nc.TerminalIPythonApp.display_banner = False\r\nc.TerminalInteractiveShell.separate_in = ''\r\nc.TerminalInteractiveShell.colors = 'Linux'\r\n```\r\n\r\nI am using an up-to-date version of IPython:\r\n\r\n```\r\n[mlw-mbair ~]$ python -c \"import IPython; print(IPython.sys_info())\"\r\n\r\n{'commit_hash': u'5a894b9',\r\n 'commit_source': 'installation',\r\n 'default_encoding': 'UTF-8',\r\n 'ipython_path': '/Users/mwaskom/anaconda/lib/python2.7/site-packages/IPython',\r\n 'ipython_version': '5.3.0',\r\n 'os_name': 'posix',\r\n 'platform': 'Darwin-13.4.0-x86_64-i386-64bit',\r\n 'sys_executable': '/Users/mwaskom/anaconda/bin/python',\r\n 'sys_platform': 'darwin',\r\n 'sys_version': '2.7.12 |Anaconda 2.3.0 (x86_64)| (default, Jul 2 2016, 17:43:17) \\n[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)]'}\r\n```\r\n\r\nand (as I think this might be relevant) matplotlib:\r\n\r\n```\r\n[mlw-mbair ~]$ python -c \"import matplotlib; print(matplotlib.__version__)\"\r\n2.0.0\r\n```\r\n\r\nThis used to work for me in the past, but various things have been updated since. I'm not sure if something has broken, or that section of the docs have gone stale, or I'm simply doing something wrong.","author":{"url":"https://github.com/mwaskom","@type":"Person","name":"mwaskom"},"datePublished":"2017-03-08T21:40:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":21},"url":"https://github.com/10384/ipython/issues/10384"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5ea2edcb-36ed-980f-6496-c063cf1f5326 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B5F2:ACE33:CFBEF3:11A7837:6A4D5903 |
| html-safe-nonce | 0152fa405c206dd0d729ad725ec336665b3fcf204b3f8d600b9ffbcdd24ca118 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUYyOkFDRTMzOkNGQkVGMzoxMUE3ODM3OjZBNEQ1OTAzIiwidmlzaXRvcl9pZCI6IjMzNTA2MDMxMjE1MzMyMTI5MzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4f2e68c00f871855ca15dee4b11529764278149ccbcbd922cd5a52dceed75ed0 |
| hovercard-subject-tag | issue:212864953 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ipython/ipython/10384/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ce1741fcef4d2a11711ce4e35387768df7960d3e6fb7515758a0b09fbfb5b7ff/ipython/ipython/issues/10384 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ce1741fcef4d2a11711ce4e35387768df7960d3e6fb7515758a0b09fbfb5b7ff/ipython/ipython/issues/10384 |
| og:image:alt | I am trying to use Mayavi in IPython (terminal at the moment) and am running into issues that are surprising me in light of the documentation on this issue. Specifically, following this page: http:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mwaskom |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2a1443ff9733a3016431263ea73c93d8fe00c195eb4a7670ac30e7848f045441 |
| turbo-cache-control | no-preview |
| go-import | github.com/ipython/ipython git https://github.com/ipython/ipython.git |
| octolytics-dimension-user_id | 230453 |
| octolytics-dimension-user_login | ipython |
| octolytics-dimension-repository_id | 658518 |
| octolytics-dimension-repository_nwo | ipython/ipython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 658518 |
| octolytics-dimension-repository_network_root_nwo | ipython/ipython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3bdd3157ea1f0fd738d408eceeead721acf1dc3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width