GUI menu bar -qtk libraries

Issue #358 invalid
Daniel Kunkel created an issue

Hello, since recently (after upgrade to ubuntu 18.04 at least) I have trouble with the GUI. Clicking on the menu bar still opens the menu, however, the menu points then listed are gone. I still can click on the menu points and I can perform the action desired, but there is much trial and error included. I also get an error message when opening MSS: INFO: MSS Version: 1.7.3 INFO: Python Version: 2.7.15 | packaged by conda-forge | (default, May 8 2018, 14:46:53) [GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] INFO: Platform: Linux-4.15.0-20-generic-x86_64-with-debian-buster-sid (('64bit', 'ELF')) INFO: Launching user interface... QGtkStyle could not resolve GTK. Make sure you have installed the proper libraries.

Any help is appreciated! Daniel

Comments (28)

  1. Daniel Kunkel reporter

    Thanks! I did not, however, the problem is still present after installation of the qt5 package. Any other qt5 packages required, I still get the same error message when starting mss.

  2. Reimar Bauer

    which desktop do you use?

    can it be temporary solved by switching to a gnome style or kde style desktop?

  3. shadow walker

    It looks like the default style is GTK, but that's not installed on Ubuntu 18? We solved a similar problem by changing the style settings. We use qt4, but it may work with qt5 as well.

    1. sudo apt install qt4-qtconfig
    2. qtconfig
    3. Appearance -> Select GUI Style: Select Cleanlooks (or any other style which is actually installed)

    Good luck!

  4. Joern Ungermann

    Here is another solution attempt using a modified LD_LIBRARY_PATH:

    https://github.com/NixOS/nixpkgs/issues/15926

    related to the fix Reimar described above.

    There are several options. Maybe Ubuntu sets there some variable incorrect for the anaconda qt version?

    QT_STYLE_OVERRIDE=gtk2 or QT_STYLE_OVERRIDE=fusion might help. Also, anaconda has likely it's own qt distribution. It for sure has on windows. Maybe that is broken? Could you try this fix here:

    https://stackoverflow.com/questions/50555973/qgtkstyle-could-not-resolve-gtk

  5. Joern Ungermann

    Digging deeper, I found that qtconfig is not available for qt5 anymore. Because it is supposed to work now automagically.

    I did not yet find an equivalent or even a method to find out what styles might be supported. On windows I could use the "fusion" style, any other keyword worked as well, but gave different optics.

    QT_QPA_PLATFORMTHEME

    might also need to be set to something supported.

  6. Reimar Bauer

    I guess KDE sets an Environment var

    QT_STYLE_OVERRIDE

    The Default for Gnome usually is adwaita

    Daniel, please can you check this env var, what the value in KDE.

  7. Joern Ungermann

    It seems that qt5/pyqt5 of anaconda3 contains only fusion and windows style. Ubuntu18 may very well assume the existance of other styles if it supplies them with it's own installation:

    root@glorim-1:/home/joernu> python
    Python 3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 18:10:19)
    [GCC 7.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from PyQt5.QtWidgets import QStyleFactory
    >>> QStyleFactory.keys()
    ['Windows', 'Fusion']
    

    If this is the case, setting the "fusion" style and possibly a platform theme should work. The QPlatform class is seemingly not exposed by pyqt5, so I cannot yet check on the supported platform themes. It would be good to also now the values of all variables starting with QT to be on the safe side, for both KDE and gnome.

    See also here:

    https://github.com/ContinuumIO/anaconda-issues/issues/32

    which suggests that the anaconda qt might try to use ubuntu qt plugins, which would be fixed by setting QT_PLUGIN_PATH to an empty string.

  8. Daniel Kunkel reporter

    Hi and thanks for all the answers, I'll go through them chronologically:

    1) qt4-qtconfig did not solve the issue

    2) QT_STYLE_OVERRIDE was not set, neither in KDE nor GNOME. Setting it to fusion in GNOME solved the problem, setting it to gtk2 did not. This is probably related to the QStyleFactory.keys() since there is no gtk2. It also works if I set it to Windows but not to GTK+. Doing the same as Joern did:

      (mssenv) 09:29:27 dkunkel@monsun:~$ python
      Python 2.7.15 | packaged by conda-forge | (default, May  8 2018, 14:46:53) 
      [GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux2 
      Type "help", "copyright", "credits" or "license" for more information.
      >>> from PyQt5.QtWidgets import QStyleFactory 
      >>> QStyleFactory.keys()
      [u'Windows', u'GTK+', u'Fusion']
    

    At least it seems that there is a workaround now.

  9. Joern Ungermann

    I double-checked on Debian. Anaconda2 has the same styles as Daniel's installation. Anaconda3 has only windows+fusion. On Windows, Anaconda3 has several windows styles (windows, windowsXP, and windowsVista) and fusion.

    However, if I specify a non-existing style, I still get a usable QT application with a default style. For providing a real fix, we need to identify why this doesn't work.

    Could you please still offer a dump of your environment and all variables starting with "QT"?

    It would also be very interesting to know, if the issue is also present on anaconda3 with python3.

  10. Daniel Kunkel reporter

    Here it is:

    10:01:56 dkunkel@monsun:~$ env | grep QT
    QT_STYLE_OVERRIDE=Windows
    QT4_IM_MODULE=xim
    QT_ACCESSIBILITY=1
    QT_IM_MODULE=ibus
    

    And as stated before QT_STYLE_OVERRIDE was not set manually.

  11. Joern Ungermann

    I just tried anaconda2+3 with all supported styles (windows/gtk+/fusion and windows/fusion) on debian and had no issues with either.

    To further pinpoint the culprit, could you please give us a dump of the output of "conda list"? With that we can replicate the specific anaconda packages that may cause the problem.

  12. Joern Ungermann

    Currently, and with your error, it seems to be a problem with gtk/gtk-support by anaconda qt.

    qtpaths --plugin-dir

    should give you the anaconda qt plugin directory <dir>

    ls <dir>/platformthemes/

    should show you

    libqgtk2.so

    Could you try a) adding the <dir>/platformthemes directory to LD_LIBRARY_PATH b) give us the output of ldd <dir>/platformthemes/libqgtk2.so

  13. Daniel Kunkel reporter

    Adding <dir>/platformthemes directory to LD_LIBRARY_PATH does not seem to have any impact. libqgtk2.so is available and the output of ldd <dir>/platformthemes/libqgtk2.so is here

  14. Daniel Kunkel reporter

    BTW, when I close mss, I also get an error message which is, at least I think so, not related to the other issue:

    CRITICAL: Fatal error: Traceback (most recent call last):
      File "/home/dkunkel/anaconda2/envs/mssenv/lib/python2.7/site-packages/mslib/msui/mss_pyui.py", line 405, in closeEvent
        def closeEvent(self, event):
    KeyboardInterrupt
    
  15. Joern Ungermann

    Maybe everything is simpler than we thought.

    With your exact pyqt5 and qt5 library versions, I get a Segmentation Fault when selecting the gtk+ theme, which certainly indicates an error.

    Could you please try installing mss anew into an environment (see documentation). This installs the most recent versions (with different bugs ;-) of all required packages and might also fix your issue. For me, it works again after updating pyqt+qt.

    I am also pretty certain, that qt5 evaluates the XDG_CURRENT_DESKTOP variable to determine the "proper" theme.

  16. Daniel Kunkel reporter

    Well, one of my tests yesterday was to install the most recent version of MSS (1.7.3). But I can do it again.

  17. Daniel Kunkel reporter

    So installed it again into a new environment, without setting QT_STYLE_OVERRIDE to Windows/fusion, I still get the error.

    Also,

    11:08:12 dkunkel@monsun:~/anaconda2/plugins/platformthemes$ env | grep "XDG_CURRENT_DESKTOP"
    XDG_CURRENT_DESKTOP=ubuntu:GNOME
    
  18. Reimar Bauer

    I think it is a cummulated issue.

    we like not to do a fixation of a lot packages as this makes it a lot more complicated for a lot users. So mss can become used with a various range of packages.

    On an ubuntu upgrade, (I do repeat this on the weekend,) we have the situation, that we remove dependencies on the scope which were available on the time we installed anaconda itselfs. The anaconda itselfs usually lives in the users home dir and is mostly disconnected from the current operation system, besides ...

    A last test for me is to get the information what happens when all packages are updated to the recent version. This is similiar to a new installation of anaconda. This means also that anaconda in the user space has a posibility by those updates to fix those dependency problems itselfs, maybe.

    https://stackoverflow.com/questions/38972052/anaconda-update-all-possible-packages

    conda update --all
    
  19. Daniel Kunkel reporter

    Well conda update --all runs into an IOError:

    ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'conda-forge::certifi-2018.4.16-py27_0'.
    IOError(13, 'Permission denied')
    Attempting to roll back.
    
    
    IOError(13, 'Permission denied')
    

    Running conda update --all -vvv gives me a lot of output of which the last lines look like this:

    Current conda install:
    
                   platform : linux-64
              conda version : 4.3.29
           conda is private : False
          conda-env version : 4.3.29
        conda-build version : not installed
             python version : 2.7.13.final.0
           requests version : 2.12.4
           root environment : /home/dkunkel/anaconda2  (writable)
        default environment : /home/dkunkel/anaconda2
           envs directories : /home/dkunkel/anaconda2/envs
                              /home/dkunkel/.conda/envs
              package cache : /home/dkunkel/anaconda2/pkgs
                              /home/dkunkel/.conda/pkgs
               channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                              https://conda.anaconda.org/conda-forge/noarch
                              https://repo.continuum.io/pkgs/main/linux-64
                              https://repo.continuum.io/pkgs/main/noarch
                              https://repo.continuum.io/pkgs/free/linux-64
                              https://repo.continuum.io/pkgs/free/noarch
                              https://repo.continuum.io/pkgs/r/linux-64
                              https://repo.continuum.io/pkgs/r/noarch
                              https://repo.continuum.io/pkgs/pro/linux-64
                              https://repo.continuum.io/pkgs/pro/noarch
                config file : /home/dkunkel/.condarc
                 netrc file : None
               offline mode : False
                 user-agent : conda/4.3.29 requests/2.12.4 CPython/2.7.13 Linux/4.15.0-22-generic debian/buster/sid glibc/2.27    
                    UID:GID : 1000:1000
    
    `$ /home/dkunkel/anaconda2/bin/conda update --all -vvv`
    
    
    
    
        Traceback (most recent call last):
          File "/home/dkunkel/anaconda2/lib/python2.7/site-packages/conda/exceptions.py", line 640, in conda_exception_handler
            return_value = func(*args, **kwargs)
          File "/home/dkunkel/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 140, in _main
            exit_code = args.func(args, p)
          File "/home/dkunkel/anaconda2/lib/python2.7/site-packages/conda/cli/main_update.py", line 65, in execute
            install(args, parser, 'update')
          File "/home/dkunkel/anaconda2/lib/python2.7/site-packages/conda/cli/install.py", line 326, in install
            execute_actions(actions, index, verbose=not context.quiet)
          File "/home/dkunkel/anaconda2/lib/python2.7/site-packages/conda/plan.py", line 830, in execute_actions
            execute_instructions(plan, index, verbose)
          File "/home/dkunkel/anaconda2/lib/python2.7/site-packages/conda/instructions.py", line 247, in execute_instructions
            cmd(state, arg)
          File "/home/dkunkel/anaconda2/lib/python2.7/site-packages/conda/instructions.py", line 108, in UNLINKLINKTRANSACTION_CMD
            txn.execute()
          File "/home/dkunkel/anaconda2/lib/python2.7/site-packages/conda/core/link.py", line 297, in execute
            rollback_excs,
        CondaMultiError: [Errno 13] Permission denied: u'/home/dkunkel/anaconda2/lib/python2.7/site-packages/certifi/__init__.py'
    

    I currently do not understand why permission is denied.

  20. Joern Ungermann

    Okay, this is getting strange now. a) I would stick to installing stuff like mss in environments. For some reason that was always more stable b) If you get strange errors like that, starting an anaconda installation from scratch might be best.

  21. Daniel Kunkel reporter

    Oh boy, if I just knew ... btw., mss is in an environment, just as the docs recommend.
    Ok thank you all again!

  22. Reimar Bauer

    OK good to know. Because this is not an issue of the mss project, I will invalidate it here. If that happens again with a recent anaconda version we have to file a report there.

  23. Reimar Bauer

    we have to look upstream if that is already known in the anaconda issue tracker or do so if it happens with a recent version again,

  24. Log in to comment