enthought / enthought/mayavi

Python 2/3 switching crashes Mayavi

Open
#801 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

```
$ rm -rf ~/.enthought && env QT_API=pyqt ETS_TOOLKIT=qt4 mayavi2 # OK under python3

(now switch from python3 to python2):

$ mayavi2 # OK under python2, but:

ERROR|2019-07-07 02:56:41,231|restoring window layout from ~/.enthought/mayavi_e3/pyface/workbench/qt4/window_memento
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pyface/workbench/workbench.py", line 319, in _restore_window_layout
memento = six.moves.cPickle.load(f)
ValueError: unsupported pickle protocol: 3

(now switch from python2 to python3):

#Change the order in pyface/qt/__init__.py:17, make PySide2 be first:

$ rm -rf ~/.enthought && env QT_API=pyqt ETS_TOOLKIT=qt4 mayavi2 # OK, but what is the following:

$ mayavi2
Traceback (most recent call last):
File "/usr/bin/mayavi2", line 11, in
load_entry_point('mayavi==4.7.1.dev0', 'gui_scripts', 'mayavi2')()
File "/usr/lib/python3/dist-packages/mayavi/scripts/mayavi2.py", line 602, in main
mayavi.main(sys.argv[1:])
File "/usr/lib/python3/dist-packages/mayavi/plugins/app.py", line 195, in main
app.run()
File "/usr/lib/python3/dist-packages/mayavi/plugins/mayavi_workbench_application.py", line 81, in run
window.open()
File "/usr/lib/python3/dist-packages/pyface/workbench/workbench_window.py", line 144, in open
self._create()
File "/usr/lib/python3/dist-packages/pyface/ui/qt4/application_window.py", line 130, in _create
contents = self._create_contents(self.control)
File "/usr/lib/python3/dist-packages/pyface/workbench/workbench_window.py", line 229, in _create_contents
self._restore_contents()
File "/usr/lib/python3/dist-packages/pyface/workbench/workbench_window.py", line 812, in _restore_contents
self.layout.set_toolkit_memento(self._memento)
File "/usr/lib/python3/dist-packages/pyface/ui/qt4/workbench/workbench_window_layout.py", line 299, in set_toolkit_memento
self.window.control.restoreGeometry(geometry)
TypeError: 'PySide2.QtWidgets.QWidget.restoreGeometry' called with wrong argument types:
PySide2.QtWidgets.QWidget.restoreGeometry(QByteArray)
Supported signatures:
PySide2.QtWidgets.QWidget.restoreGeometry(PySide2.QtCore.QByteArray)

#Change the order in pyface/qt/__init__.py:17 back, make it be default:

$ mayavi2
Traceback (most recent call last):
File "/usr/bin/mayavi2", line 11, in
load_entry_point('mayavi==4.7.1.dev0', 'gui_scripts', 'mayavi2')()
File "/usr/lib/python3/dist-packages/mayavi/scripts/mayavi2.py", line 602, in main
mayavi.main(sys.argv[1:])
File "/usr/lib/python3/dist-packages/mayavi/plugins/app.py", line 195, in main
app.run()
File "/usr/lib/python3/dist-packages/mayavi/plugins/mayavi_workbench_application.py", line 81, in run
window.open()
File "/usr/lib/python3/dist-packages/pyface/workbench/workbench_window.py", line 144, in open
self._create()
File "/usr/lib/python3/dist-packages/pyface/ui/qt4/application_window.py", line 130, in _create
contents = self._create_contents(self.control)
File "/usr/lib/python3/dist-packages/pyface/workbench/workbench_window.py", line 229, in _create_contents
self._restore_contents()
File "/usr/lib/python3/dist-packages/pyface/workbench/workbench_window.py", line 812, in _restore_contents
self.layout.set_toolkit_memento(self._memento)
File "/usr/lib/python3/dist-packages/pyface/ui/qt4/workbench/workbench_window_layout.py", line 299, in set_toolkit_memento
self.window.control.restoreGeometry(geometry)
TypeError: 'PySide.QtGui.QWidget.restoreGeometry' called with wrong argument types:
PySide.QtGui.QWidget.restoreGeometry(QByteArray)
Supported signatures:
PySide.QtGui.QWidget.restoreGeometry(PySide.QtCore.QByteArray)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.