conda-forge / mayavi-feedstock

A conda-smithy repository for mayavi.
BSD 3-Clause "New" or "Revised" License
4 stars 18 forks source link

No module names 'wx' #4

Closed dfroger closed 2 years ago

dfroger commented 7 years ago

On my laptop (archlinux), running mayavi2:

Traceback (most recent call last):
  File "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/mayavi/scripts/mayavi2.py", line 476, in <module>
    from mayavi.plugins.app import Mayavi, setup_logger
  File "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/mayavi/plugins/app.py", line 19, in <module>
    from .mayavi_workbench_application import MayaviWorkbenchApplication
  File "/data/miniconda3/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 "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/envisage/ui/workbench/api.py", line 4, in <module>
    from .workbench import Workbench
  File "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/envisage/ui/workbench/workbench.py", line 5, in <module>
    import pyface.workbench.api as pyface
  File "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/pyface/workbench/api.py", line 4, in <module>
    from .editor import Editor
  File "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/pyface/workbench/editor.py", line 18, in <module>
    from pyface.toolkit import toolkit_object
  File "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/pyface/toolkit.py", line 99, in <module>
    _init_toolkit()
  File "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/pyface/toolkit.py", line 65, in _init_toolkit
    be = import_toolkit(ETSConfig.toolkit)
  File "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/pyface/toolkit.py", line 58, in import_toolkit
    __import__(be + 'init')
  File "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/pyface/ui/wx/init.py", line 14, in <module>
    import wx
ImportError: No module named 'wx'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/miniconda3/envs/mayavi/bin/mayavi2", line 4, in <module>
    import mayavi.scripts.mayavi2
  File "/data/miniconda3/envs/mayavi/lib/python3.5/site-packages/mayavi/scripts/mayavi2.py", line 494, in <module>
    raise ImportError(msg)
ImportError: No module named 'wx'
________________________________________________________________________________
Could not load envisage. You might have a missing dependency.
Do you have the EnvisageCore and EnvisagePlugins installed?

If you installed Mayavi with easy_install, try 'easy_install <pkg_name>'.
'easy_install Mayavi[app]' will also work.

If you performed a source checkout and installed via 'python setup.py develop',
be sure to run the same command in the EnvisageCore and EnvisagePlugins folders.

If these packages appear to be installed, check that your numpy and
configobj are installed and working. If you need numpy, 'easy_install numpy'
will install numpy. Similarly, 'easy_install configobj' will install
configobj.
Cadair commented 7 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)

dfroger commented 7 years ago

yes, there a doc on toolkit selection ('qt4', 'wx').

On another machine (debian 8), the conda package works for me

Cadair commented 7 years ago

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.

dfroger commented 7 years ago

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...

dfroger commented 7 years ago

I'll have to check for a possible forgotten ETS_TOOLKIT='wx' environment variable on my laptop...

Cadair commented 7 years ago

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'
dfroger commented 7 years ago

ETS_TOOLKIT was set to wx on my archlinux linux. Unsetting it, mayavi2 works.

dfroger commented 7 years ago

@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
dfroger commented 7 years ago

@cadair and what does ETS_TOOLKIT=qt4 mayavi2 gives?

Cadair commented 7 years ago
 ❯ 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'
dfroger commented 7 years ago

@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
larsoner commented 2 years ago

Closing as stale, but feel free to reopen if this is still an issue