Closed dfroger closed 2 years ago
rather than worrying about building wx is it not possible to make ETS use pyqt? (which I think there are already conda packages for)
yes, there a doc on toolkit selection ('qt4', 'wx').
On another machine (debian 8), the conda package works for me
I have not had a chance to try this yet as I am travelling. I also run arch so will do some experiments next time I get a stable internet connection.
ok, I'm curious to see if the ImportError reproduces for you!
pyqt
is already a run requirement.
I don't have my archlinux laptop, so I'll experiment later too...
I'll have to check for a possible forgotten ETS_TOOLKIT='wx'
environment variable on my laptop...
So by default I get:
❯ mayavi2
Traceback (most recent call last):
File "/opt/miniconda/envs/mayavi/bin/mayavi2", line 6, in <module>
sys.exit(mayavi.scripts.mayavi2.main())
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/mayavi/scripts/mayavi2.py", line 647, in main
'''
ImportError: Could not import backend for traits
and if I set ETS_TOOLKIT='pyqt'
I get:
❯ mayavi2
Traceback (most recent call last):
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/mayavi/scripts/mayavi2.py", line 476, in <module>
from mayavi.plugins.app import Mayavi, setup_logger
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/mayavi/plugins/app.py", line 19, in <module>
from .mayavi_workbench_application import MayaviWorkbenchApplication
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/mayavi/plugins/mayavi_workbench_application.py", line 13, in <module>
from envisage.ui.workbench.api import WorkbenchApplication
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/envisage/ui/workbench/api.py", line 4, in <module>
from .workbench import Workbench
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/envisage/ui/workbench/workbench.py", line 5, in <module>
import pyface.workbench.api as pyface
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/workbench/api.py", line 4, in <module>
from .editor import Editor
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/workbench/editor.py", line 18, in <module>
from pyface.toolkit import toolkit_object
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/toolkit.py", line 99, in <module>
_init_toolkit()
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/toolkit.py", line 65, in _init_toolkit
be = import_toolkit(ETSConfig.toolkit)
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/toolkit.py", line 58, in import_toolkit
__import__(be + 'init')
ImportError: No module named 'pyface.ui.pyqt'
ETS_TOOLKIT
was set to wx
on my archlinux linux. Unsetting it, mayavi2
works.
@cadair here is my conda env, I suppose you have the same?
$ conda list
# packages in environment at /data/miniconda3/envs/mayavi:
#
apptools 4.4.0 py35_0 conda-forge
ca-certificates 2016.9.26 0 conda-forge
cairo 1.14.6 0 conda-forge
certifi 2016.9.26 py35_0 conda-forge
configobj 5.0.6 py35_0
envisage 4.5.1 py35_0 conda-forge
expat 2.1.0 2 conda-forge
fontconfig 2.11.1 6 conda-forge
freetype 2.6.3 1 conda-forge
future 0.15.2 py35_0 conda-forge
gettext 0.19.7 1 conda-forge
glib 2.51.0 2 conda-forge
harfbuzz 1.3.4 0 conda-forge
hdf5 1.8.17 9 conda-forge
icu 56.1 4 conda-forge
jpeg 9b 0 conda-forge
jsoncpp 0.10.6 1 conda-forge
libffi 3.2.1 3 conda-forge
libgfortran 3.0.0 1
libiconv 1.14 4 conda-forge
libpng 1.6.28 0 conda-forge
libtiff 4.0.6 7 conda-forge
libxml2 2.9.4 3 conda-forge
mayavi 4.5.0 np111py35_0 conda-forge
mkl 2017.0.1 0
ncurses 5.9 10 conda-forge
numpy 1.11.3 py35_0
openssl 1.0.2h 3 conda-forge
pango 1.40.3 0 conda-forge
pcre 8.39 0 conda-forge
pip 9.0.1 py35_0 conda-forge
pixman 0.34.0 0 conda-forge
pyface 5.1.0 py35_0 conda-forge
pygments 2.1.3 py35_1 conda-forge
pyqt 4.11.4 py35_2 conda-forge
python 3.5.2 4 conda-forge
qt 4.8.7 3 conda-forge
readline 6.2 0 conda-forge
setuptools 32.3.1 py35_0 conda-forge
sip 4.18 py35_1 conda-forge
six 1.10.0 py35_1 conda-forge
sqlite 3.13.0 1 conda-forge
tk 8.5.19 1 conda-forge
traits 4.6.0 py35_1 conda-forge
traitsui 5.1.0 py35_0 conda-forge
vtk 7.1.0 py35_2 conda-forge
wheel 0.29.0 py35_0 conda-forge
xz 5.2.2 0 conda-forge
zlib 1.2.8 3 conda-forge
@cadair and what does ETS_TOOLKIT=qt4 mayavi2
gives?
❯ mayavi2
Traceback (most recent call last):
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/mayavi/scripts/mayavi2.py", line 476, in <module>
from mayavi.plugins.app import Mayavi, setup_logger
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/mayavi/plugins/app.py", line 19, in <module>
from .mayavi_workbench_application import MayaviWorkbenchApplication
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/mayavi/plugins/mayavi_workbench_application.py", line 13, in <module>
from envisage.ui.workbench.api import WorkbenchApplication
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/envisage/ui/workbench/api.py", line 4, in <module>
from .workbench import Workbench
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/envisage/ui/workbench/workbench.py", line 5, in <module>
import pyface.workbench.api as pyface
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/workbench/api.py", line 4, in <module>
from .editor import Editor
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/workbench/editor.py", line 18, in <module>
from pyface.toolkit import toolkit_object
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/toolkit.py", line 99, in <module>
_init_toolkit()
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/toolkit.py", line 65, in _init_toolkit
be = import_toolkit(ETSConfig.toolkit)
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/toolkit.py", line 58, in import_toolkit
__import__(be + 'init')
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/ui/qt4/init.py", line 18, in <module>
from pyface.qt import QtCore, QtGui, qt_api
File "/opt/miniconda/envs/mayavi/lib/python3.5/site-packages/pyface/qt/QtGui.py", line 4, in <module>
from PyQt4.Qt import QKeySequence, QTextCursor
ImportError: cannot import name 'QKeySequence'
@Cadair and does the pyqt package itself works for you?
conda create -c conda-forge -n pyqt pyqt python=3.5
python -c 'from PyQt4.Qt import QKeySequence, QTextCursor'
I have these environement variables
$ env | grep ETS
# nothing
$ env | grep QT
QT_QPA_PLATFORMTHEME=lxqt # don't know where they come from
QT_PLATFORM_PLUGIN=lxqt
Closing as stale, but feel free to reopen if this is still an issue
On my laptop (archlinux), running
mayavi2
: