Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not build genfire Cannot load backend 'Qt5Agg' which requires the 'qt5' #2

Closed
kevinsmia1939 opened this issue Apr 14, 2020 · 6 comments

Comments

@kevinsmia1939
Copy link

Hello,

I could not build ncempy on openSUSE Tumbleweed.
I am trying to submit genfire to openSUSE repository at the moment.
I tried installing python3-qt5 and python3-matplotlib-qt5 but the error still occur.

The dependency I install are:

Requires:       python3-Pillow 
Requires:       python3-PyQt5 
Requires:       python3-matplotlib 
Requires:       python3-numpy 
Requires:       python3-pyparsing 
Requires:       python3-scipy 
Requires:       python3-setuptools
Requires:       python3-pyFFTW
Requires:       python3-matplotlib-qt5
Requires:       python3-qt5

The error are shown below.
Thanks.

[    7s] running test
[    7s] WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
[    8s] running egg_info
[    8s] writing genfire.egg-info/PKG-INFO
[    8s] writing dependency_links to genfire.egg-info/dependency_links.txt
[    8s] writing requirements to genfire.egg-info/requires.txt
[    8s] writing top-level names to genfire.egg-info/top_level.txt
[    8s] reading manifest file 'genfire.egg-info/SOURCES.txt'
[    8s] writing manifest file 'genfire.egg-info/SOURCES.txt'
[    8s] running build_ext
[    8s] genfire (unittest.loader._FailedTest) ... ERROR
[    8s] 
[    8s] ======================================================================
[    8s] ERROR: genfire (unittest.loader._FailedTest)
[    8s] ----------------------------------------------------------------------
[    8s] ImportError: Failed to import test module: genfire
[    8s] Traceback (most recent call last):
[    8s]   File "/usr/lib64/python3.8/unittest/loader.py", line 470, in _find_test_path
[    8s]     package = self._get_module_from_name(name)
[    8s]   File "/usr/lib64/python3.8/unittest/loader.py", line 377, in _get_module_from_name
[    8s]     __import__(name)
[    8s]   File "/home/abuild/rpmbuild/BUILD/GENFIRE-Python-1.1.11+git.1512394233.b7b46da/genfire/__init__.py", line 4, in <module>
[    8s]     from . import gui
[    8s]   File "/home/abuild/rpmbuild/BUILD/GENFIRE-Python-1.1.11+git.1512394233.b7b46da/genfire/gui/__init__.py", line 2, in <module>
[    8s]     from . import VolumeSlicer
[    8s]   File "/home/abuild/rpmbuild/BUILD/GENFIRE-Python-1.1.11+git.1512394233.b7b46da/genfire/gui/VolumeSlicer.py", line 16, in <module>
[    8s]     matplotlib.use("Qt5Agg")
[    8s]   File "/usr/lib64/python3.8/site-packages/matplotlib/cbook/deprecation.py", line 307, in wrapper
[    8s]     return func(*args, **kwargs)
[    8s]   File "/usr/lib64/python3.8/site-packages/matplotlib/__init__.py", line 1307, in use
[    8s]     switch_backend(name)
[    8s]   File "/usr/lib64/python3.8/site-packages/matplotlib/pyplot.py", line 233, in switch_backend
[    8s]     raise ImportError(
[    8s] ImportError: Cannot load backend 'Qt5Agg' which requires the 'qt5' interactive framework, as 'headless' is currently running
[    8s] 
[    8s] 
[    8s] ----------------------------------------------------------------------
[    8s] Ran 1 test in 0.000s
[    8s] 
[    8s] FAILED (errors=1)
[    8s] Test failed: <unittest.runner.TextTestResult run=1 errors=1 failures=0>
[    8s] error: Test failed: <unittest.runner.TextTestResult run=1 errors=1 failures=0>

Full error log here: https://build.opensuse.org/package/live_build_log/home:andythe_great/python3-genfire/openSUSE_Tumbleweed/x86_64

@apryor6
Copy link
Collaborator

apryor6 commented Apr 14, 2020

Sorry you are having this problem. I’m unfortunately unable to maintain this project due to time constraints. I will say that Qt can be pretty fickle, especially with Python. It’s likely that in the time since this was last updated there has been a breaking change in one of the dependencies. You might find running pip install -U for some of the requirements of this project resolves the issue.
If you are able to resolve, I’ll happily review and accept a PR.

@kevinsmia1939
Copy link
Author

Sorry you are having this problem. I’m unfortunately unable to maintain this project due to time constraints. I will say that Qt can be pretty fickle, especially with Python. It’s likely that in the time since this was last updated there has been a breaking change in one of the dependencies. You might find running pip install -U for some of the requirements of this project resolves the issue.
If you are able to resolve, I’ll happily review and accept a PR.

Thanks for the reply.
I check all the required dependency, it seems to be satisfied, but still same error.
I need this package for openNCEM.

Could this error due to matplot? Anyway, I will try to figure it out.

@kevinsmia1939
Copy link
Author

Some searching on the error, I found some other python with the same issue.

ludwig-ai/ludwig#46
ludwig-ai/ludwig@2d84dbd

@ercius
Copy link

ercius commented May 11, 2020

@kevinsmia1939 We could use a little more information regarding your setup. If you are using a 'headless' machines (i.e. no graphical user interface) then the GUI will stop this from working.

@thomasaarholt
Copy link

I was running genfire in jupyter notebook over an ssh tunnel, an experienced the same problem. Since I don't need the GUI, qt5 isn't necessary.

I commented out all uses of matplotlib.use("Qt5Agg"), and it imports fine.

@kevinsmia1939
Copy link
Author

I was running genfire in jupyter notebook over an ssh tunnel, an experienced the same problem. Since I don't need the GUI, qt5 isn't necessary.

I commented out all uses of matplotlib.use("Qt5Agg"), and it imports fine.

I add Xvfb deoendency to the package, the test works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants