Bug 2084297 - does not start due to missing Qt and Python modules
Summary: does not start due to missing Qt and Python modules
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: PyMca
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zbigniew Jędrzejewski-Szmek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-11 20:48 UTC by René Genz
Modified: 2022-05-25 01:23 UTC (History)
3 users (show)

Fixed In Version: PyMca-5.6.7-5.fc37 PyMca-5.6.7-6.fc36 PyMca-5.6.7-5.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-25 01:03:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description René Genz 2022-05-11 20:48:14 UTC
Description of problem:
PyMca does not start, i.e. starts, prints error message, closes

Version-Release number of selected component (if applicable):
PyMca-5.6.7-3.fc36.rpm

How reproducible:
always

Steps to Reproduce:
1. install Fedora 36 Workstation
2. $ sudo dnf install -y PyMca
3. $ pymca

Actual results:
Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/PyMca5/PyMcaGui/PyMcaQt.py", line 74, in <module>
    import PyQt5.QtCore
ModuleNotFoundError: No module named 'PyQt5'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/PyMca5/PyMcaGui/PyMcaQt.py", line 80, in <module>
    import PySide2.QtCore
ModuleNotFoundError: No module named 'PySide2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/PyMca5/PyMcaGui/PyMcaQt.py", line 86, in <module>
    import sip
ModuleNotFoundError: No module named 'sip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/PyMca5/PyMcaGui/PyMcaQt.py", line 101, in <module>
    import PySide.QtCore
ModuleNotFoundError: No module named 'PySide'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pymca", line 18, in <module>
    exec(code)
  File "<string>", line 146, in <module>
  File "/usr/lib64/python3.10/site-packages/PyMca5/PyMcaGui/PyMcaQt.py", line 104, in <module>
    raise ImportError(
ImportError: No Qt wrapper found. Install PyQt5, PyQt4, PySide or PySide2.



This can be fixed with:
$ sudo dnf install -y PyQt5 # installs python3-qt5

But results in a different error message at program start:
$ pymca
<class 'ModuleNotFoundError'> No module named 'matplotlib.backends.backend_qt5agg'   File "/usr/bin/pymca", line 18, in <module>
    exec(code)
  File "<string>", line 239, in <module>
  File "/usr/lib64/python3.10/site-packages/PyMca5/PyMcaGui/pymca/ScanWindow.py", line 56, in <module>
    from PyMca5.PyMcaGui import QPyMcaMatplotlibSave1D
  File "/usr/lib64/python3.10/site-packages/PyMca5/PyMcaGui/pymca/QPyMcaMatplotlibSave1D.py", line 44, in <module>
    from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas



This can be fixed with:
$ sudo dnf install -y python3-matplotlib-qt5

# success - program starts, only a warning printed in terminal
$ pymca
WARNING:PyMca5.PyMcaPhysics.xrf.FisxHelper:Consider to use fisx >= 1.2.0



Expected results:
program starts


Additional info:
The shortcut is to add a dependency on "python3-matplotlib-qt5", because it pulls in "python3-qt5-base" automatically




I wonder if these changes to the spec file:
https://src.fedoraproject.org/rpms/PyMca/blob/rawhide/f/PyMca.spec
would be sufficient:
*
change:
BuildRequires:  python3-matplotlib-qt5
to:
Requires:  python3-matplotlib-qt5



Please, change:
PyMCA provides
to:
PyMca provides

I guess this will update too the text at:
https://src.fedoraproject.org/rpms/PyMca

Comment 1 Fedora Update System 2022-05-12 08:09:53 UTC
FEDORA-2022-7d5f07fafb has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-7d5f07fafb

Comment 2 Fedora Update System 2022-05-12 08:11:26 UTC
FEDORA-2022-7d5f07fafb has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 3 Fedora Update System 2022-05-12 08:25:04 UTC
FEDORA-2022-b6447db8cd has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-b6447db8cd

Comment 4 Fedora Update System 2022-05-12 08:25:05 UTC
FEDORA-2022-7bb7249955 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-7bb7249955

Comment 5 Fedora Update System 2022-05-12 15:57:22 UTC
FEDORA-2022-b6447db8cd has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-b6447db8cd`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-b6447db8cd

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 René Genz 2022-05-12 21:35:25 UTC
Thank you!

Regarding "PyMCA => PyMca": can be left as is; I thought it was a typo; I was not aware of the history http://pymca.sourceforge.net/faq.html#mozTocId556491

Comment 7 Fedora Update System 2022-05-13 02:10:50 UTC
FEDORA-2022-7bb7249955 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-7bb7249955`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-7bb7249955

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 René Genz 2022-05-15 20:34:21 UTC
I recompiled the RPM file with `rpmrebuild -enp PyMca-5.6.7-5.fc36.x86_64.rpm` for testing (just started to learn RPM packaging). My goal was to make all programs of PyMca work out of the box after installation. I would use the the first solution.

The shortest possible solution is:
> Requires: python3-matplotlib-qt5



Using boolean operators makes installation requirements flexible:
> Requires: (python3-pyqt5 or python3-PyQt4 or python3-pyside2)
> Requires: python3-matplotlib-qt5

If PySide2 or PyQt4 has been installed before installing PyMca, then python3-qt5 is installed, but only as dependency of python3-matplotlib-qt5. PySide is not available in Fedora 36, hence left out.
I use explicit package names, because it looks better to me, because only "PyQt5" can be resolved on Fedora 36. I tried "python3.10dist(PySide2)" and "python3dist(PyQt4)" and variations, including capitalization to no avail. I do not understand these commands, yet.


One can argue for:
> Requires: (python3-pyqt5 or python3-PyQt4 or python3-pyside2)
> Recommends: python3-matplotlib-qt5
because only PyMca requires it, not any of the other programs in the package. But on installation error no error is printed, hence I would not use it. This behavior is as intended (see "Weak dependencies"): https://rpm-software-management.github.io/rpm/manual/dependencies.html


Other commands I used for testing:
# ran only once
$ dnf download PyMca PyMca-data --enablerepo updates-testing

# after recompilation to avoid redownload of RPMs for installation
$ cp ${HOME}/rpmbuild/RPMS/x86_64/PyMca-5.6.7-13.fc36.x86_64.rpm .
$ sudo dnf install --setopt=keepcache=true -y PyMca-5.6.7-13.fc36.x86_64.rpm PyMca-data-5.6.7-5.fc36.noarch.rpm

Comment 9 Zbigniew Jędrzejewski-Szmek 2022-05-16 11:32:59 UTC
I broke the fix in the second patch. Please test the update I'll submit now.

Comment 10 Fedora Update System 2022-05-17 01:15:15 UTC
FEDORA-2022-b6447db8cd has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-b6447db8cd`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-b6447db8cd

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2022-05-17 02:31:20 UTC
FEDORA-2022-7bb7249955 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-7bb7249955`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-7bb7249955

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2022-05-25 01:03:55 UTC
FEDORA-2022-b6447db8cd has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2022-05-25 01:23:58 UTC
FEDORA-2022-7bb7249955 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.