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

No module named src.app #1

Open
Svenum opened this issue Aug 26, 2024 · 14 comments
Open

No module named src.app #1

Svenum opened this issue Aug 26, 2024 · 14 comments

Comments

@Svenum
Copy link

Svenum commented Aug 26, 2024

Hi,
I saw this project and would try it on nix, but if I execute it I got this error:

Traceback (most recent call last):
  File "/nix/store/42z1nvysrz95ccwjd4ss2jibf9ch3la7-python3.12-fw-fanctrl-gui-26-08-2024/bin/.fw-fanctrl-gui-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/42z1nvysrz95ccwjd4ss2jibf9ch3la7-python3.12-fw-fanctrl-gui-26-08-2024/lib/python3.12/site-packages/src/__main__.py", line 2, in main
    from .index import start
  File "/nix/store/42z1nvysrz95ccwjd4ss2jibf9ch3la7-python3.12-fw-fanctrl-gui-26-08-2024/lib/python3.12/site-packages/src/index.py", line 7, in <module>
    from src.app.MainWindow import main
ModuleNotFoundError: No module named 'src.app'

Have you any idea?

@leopoldhub
Copy link
Owner

leopoldhub commented Aug 26, 2024

Hi,

The project is still in a very early stage, I am still trying to figure out the project structure and configurations.

The app cannot be executed as is, you need to install it with pip, then execute it with its name (fw-fanctrl-gui), or the command python -m src.

Could you also describe the steps you did to execute it?

@leopoldhub
Copy link
Owner

leopoldhub commented Aug 26, 2024

By the way, who was ChangjingZhang?
I saw the messages In my mails but I cannot see them on github and report him.

@Svenum
Copy link
Author

Svenum commented Aug 26, 2024

He is already blocked and github removed the commends

@Svenum
Copy link
Author

Svenum commented Aug 26, 2024

If I replace packages=["src"] with packages=["src", "src.app", "src.service", "src.exception"] in the setup.py it works.

But now I get

QIODevice::read (QFile, "resources/ui/main/main.ui"): device not open
Designer: An error has occurred while reading the UI file at line 1, column 0: Premature end of document.
Traceback (most recent call last):
  File "/nix/store/hps2jabva0rq38wm2g56bpa51zvwfqwz-python3.12-fw-fanctrl-gui-26-08-2024/bin/.fw-fanctrl-gui-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/hps2jabva0rq38wm2g56bpa51zvwfqwz-python3.12-fw-fanctrl-gui-26-08-2024/lib/python3.12/site-packages/src/__main__.py", line 4, in main
    start()
  File "/nix/store/hps2jabva0rq38wm2g56bpa51zvwfqwz-python3.12-fw-fanctrl-gui-26-08-2024/lib/python3.12/site-packages/src/index.py", line 30, in start
    window = main(args, app, fanctrlService)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/hps2jabva0rq38wm2g56bpa51zvwfqwz-python3.12-fw-fanctrl-gui-26-08-2024/lib/python3.12/site-packages/src/app/MainWindow.py", line 170, in main
    window = MainWindow(icon, fanctrlService)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/hps2jabva0rq38wm2g56bpa51zvwfqwz-python3.12-fw-fanctrl-gui-26-08-2024/lib/python3.12/site-packages/src/app/MainWindow.py", line 16, in __init__
    self.ui = QtUiTools.QUiLoader().load("resources/ui/main/main.ui")
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Unable to open/read ui device

I think its because the resources folder is not imported.

@Svenum
Copy link
Author

Svenum commented Aug 26, 2024

If I execute the build in the folder where the resources folder is present it works.

@leopoldhub
Copy link
Owner

Thanks, maybe I missed something... I will check that later on, I do not have much time these days 😅

I am also thinking of using PyInstaller to make a one click install without worring about Python version and virtualenv.

@Svenum
Copy link
Author

Svenum commented Aug 26, 2024

Nice. If the nix build work I would love too add the gui as experimental feature to the fw-fanctrl nix flake. Would this ne bine for you?

@leopoldhub
Copy link
Owner

I appreciate the intention, but

  1. We should not make a direct link from fw-fanctrl to this project without @TamtamHero 's approval.
  2. I think it is important to have the project structure ready and conventions defined before actually distributing it, so that we avoid breaking people's configs in future changes.

I will try to have it working properly on all platforms by Tuesday if you want to try it.

@TamtamHero
Copy link

Approval granted! Nice job :)

@leopoldhub
Copy link
Owner

Thanks a lot,

This is a project I can work on without my main pc at hand during this one-month absence, I will do my best to work on it when I find some time :)

It is also an opportunity to work with the standard pip installation (as described in TamtamHero/fw-fanctrl#73) and get it right before implementing it in the core project.

Have a nice day!

@leopoldhub
Copy link
Owner

leopoldhub commented Sep 9, 2024

(ps. I may not be available during normal hours due to time zones and working hours, If you contact me, I will answer as soon as I can)

@Svenum
Copy link
Author

Svenum commented Dec 4, 2024

Some news on this front?

@leopoldhub
Copy link
Owner

Hi @Svenum , how are you doing?
Didn't had quite the time those last few months, I plan to rework a part of the project structure soon.

@Svenum
Copy link
Author

Svenum commented Dec 9, 2024

I am doing good. That sound great. I really looking into this project.

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
@TamtamHero @leopoldhub @Svenum and others