Skip to content

ModuleNotFoundError: No module named 'PyQt6' #9626

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

Open
1 task done
stsp opened this issue Mar 11, 2025 · 4 comments
Open
1 task done

ModuleNotFoundError: No module named 'PyQt6' #9626

stsp opened this issue Mar 11, 2025 · 4 comments

Comments

@stsp
Copy link

stsp commented Mar 11, 2025

Is there an existing issue for this already?

  • I have searched the existing issues

Description

Ubuntu-24.10.

Cloned the electrum repo and did:
pipx install .
That succeeded.
But then:

$ electrum
  0.50 | E | daemon.Daemon | GUI raised exception: SystemExit("Error: Could not import PyQt6. On Linux systems, you may try 'sudo apt-get install python3-pyqt6'"). shutting down.
  0.50 | E | __main__ | daemon.run_gui errored
Traceback (most recent call last):
  File "/home/stas/.local/pipx/venvs/electrum/lib/python3.12/site-packages/electrum/gui/qt/__init__.py", line 33, in <module>
    import PyQt6
ModuleNotFoundError: No module named 'PyQt6'

But its actually installed:

$ sudo apt-get install python3-pyqt6
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pyqt6 is already the newest version (6.7.1-1).
0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.

So what to do?

@stsp
Copy link
Author

stsp commented Mar 11, 2025

Tried this:

$ pipx install pyqt6
  installed package pyqt6 6.8.1, installed using Python 3.12.7
  These apps are now globally available
    - pylupdate6
    - pyuic6
done! ✨ 🌟 ✨

Still the same error running electrum.

@SomberNight
Copy link
Member

Cloned the electrum repo and did:
pipx install .

maybe try $ pipx install ".[gui,crypto]"

@stsp
Copy link
Author

stsp commented Mar 11, 2025

Hmm, I am sure I did that
too, but when fighting with
#9625
Now I tried that for this
particular problem, and it
is a solution.
Thanks!

Would you like to amend the
error msg before closing this
ticket?

@stsp
Copy link
Author

stsp commented Mar 11, 2025

Full error msg looks like this:

$ electrum
  0.31 | E | daemon.Daemon | GUI raised exception: SystemExit("Error: Could not import PyQt6. On Linux systems, you may try 'sudo apt-get install python3-pyqt6'"). shutting down.
  0.31 | E | __main__ | daemon.run_gui errored
Traceback (most recent call last):
  File "/home/stas/.local/pipx/venvs/electrum/lib/python3.12/site-packages/electrum/gui/qt/__init__.py", line 33, in <module>
    import PyQt6
ModuleNotFoundError: No module named 'PyQt6'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/stas/.local/pipx/venvs/electrum/lib/python3.12/site-packages/electrum/daemon.py", line 593, in run_gui
    gui = __import__('electrum.gui.' + gui_name, fromlist=['electrum'])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stas/.local/pipx/venvs/electrum/lib/python3.12/site-packages/electrum/gui/qt/__init__.py", line 37, in <module>
    raise GuiImportError(
electrum.GuiImportError: Error: Could not import PyQt6. On Linux systems, you may try 'sudo apt-get install python3-pyqt6'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stas/.local/bin/electrum", line 466, in handle_cmd
    d.run_gui()
  File "/home/stas/.local/pipx/venvs/electrum/lib/python3.12/site-packages/electrum/daemon.py", line 595, in 

So there is something to fix,
nested exceptions...

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

2 participants