alou-S / omen-fan

Utility to control fans in Omen laptops
GNU General Public License v3.0
51 stars 6 forks source link

Missing modules when executing the script on Debian #11

Open CiscoDeTours opened 4 months ago

CiscoDeTours commented 4 months ago

INFORMATION

Python version

~$ python3 --version 

Python 3.11.2

System

~$ neofetch

DEVICE 
•PC: OMEN by HP Laptop 16-c0xxx 

SOFTWARE 
•Distro: Debian GNU/Linux 12 (bookworm) 
•Desktop: GNOME 43.9 
•Session: wayland 
•Kernel: 6.6.15-amd64 
•Shell: bash 5.2.15 
•Packages: 2651 (dpkg), 81 (flatpak) 

COMPONENTS 
•CPU: AMD Ryzen 9 5900HX with Radeon Graphics (16) @ 4.680GHz 
•GPU: AMD ATI Radeon RX 6600/6600 XT/6600M 
•GPU: AMD ATI Radeon Vega Series / Radeon Vega Mobile Series 
•Memory: 3,47GiB / 14,97GiB (23%) 

EXECUTION SUMMARY

~$ ./omen-fan.py

Traceback (most recent call last):
  File "/home/francisco/Datos/OMEN Fan/./omen-fan.py", line 10, in <module>
    import click
ModuleNotFoundError: No module named 'click'
sudo apt install python3-click

The first missing module is click and can be installed.

$ ./omen-fan.py
Traceback (most recent call last):
  File "/home/francisco/Datos/OMEN Fan/./omen-fan.py", line 11, in <module>
    import tomlkit
ModuleNotFoundError: No module named 'tomlkit'
sudo apt install python3-tomlkit

The second missing module is tomlkit and can be installed too.

~$ ./omen-fan.py

Traceback (most recent call last):
  File "/home/francisco/Datos/OMEN Fan/./omen-fan.py", line 12, in <module>
    from click_aliases import ClickAliasedGroup
ModuleNotFoundError: No module named 'click_aliases'

The third missing module is click_aliases and it's an obstacle because is not present in Debian repositories unlike Arch.

alou-S commented 4 months ago

I think you could globally install it using pip and it should work.

CiscoDeTours commented 3 months ago

The missing module can be installed if a virtual python environment (vpe) is created; tomlkit needed to be reinstalled using pip.

(vpe) ~$ ./omen-fan.py 

Usage: omen-fan.py [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  bios-control (b)      Enable/Disable BIOS control
  boost (x)             Enables boost mode via sysfs
  configure (c,config)  Configure Fan curves for service
  info (i)              Gets Fan status
  service (e)           Start/Stop Fan management service
  set (s)               Set Fan Speed (Disables BIOS control) Fan speed can
                        be...
  version (v)           Gives version info

Root access is requested to make changes but an error message always pops up:

(vpe) ~$ ./omen-fan.py e 1

Root access is required for this command.
Please run the program as root.
(vpe) # ./omen-fan.py e 1

Traceback (most recent call last):
  File "/home/francisco/Datos/OMEN Fan/./omen-fan.py", line 340, in <module>
    cli()
  File "/home/francisco/vpe/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/francisco/vpe/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/francisco/vpe/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/francisco/vpe/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/francisco/vpe/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/francisco/Datos/OMEN Fan/./omen-fan.py", line 249, in service_cli
    load_ec_module()
  File "/home/francisco/Datos/OMEN Fan/./omen-fan.py", line 99, in load_ec_module
    subprocess.run(["modprobe", "ec_sys", "write_support=1"], check=True)
  File "/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'modprobe'
azy9 commented 3 months ago

hello. disabling secure boot helped me in this situation. but now i have "FileNotFoundError: [Errno 2] No such file or directory: 'omen-fand' "

CiscoDeTours commented 3 months ago

@realazizbek

Disabling Secure Boot gives me exactly the same results posted before, so I assume that my problem is related to another factor.

Dranick commented 1 month ago

hello. disabling secure boot helped me in this situation. but now i have "FileNotFoundError: [Errno 2] No such file or directory: 'omen-fand' "

try sudo ln -s /path/to/omen-fand.py /bin/omen-fand or edit omen-fan.py line 256 subprocess.Popen("/absolute/path/to/omen-fand.py")