Askannz / optimus-manager

A Linux program to handle GPU switching on Optimus laptops.
MIT License
2.28k stars 166 forks source link

Unable to run optimus-manager: Python ModuleNotFoundError #569

Closed CodePurble closed 3 months ago

CodePurble commented 3 months ago

Describe the bug I freshly installed Arch linux, and optimus-manager does not run, it exits with the below error:

Traceback (most recent call last):
  File "/usr/bin/optimus-manager", line 5, in <module>
    from optimus_manager.client import main
ModuleNotFoundError: No module named 'optimus_manager'

I believe there is something wrong with the install as Python is not able to find the required files. I have installed the optimus-manager package from the AUR, with no manual intervention. Is there an issue with my Python installation by any chance?

optimus-manager was working perfectly fine in all my earlier installations on the same device.

System info Please include :

Logs

 systemctl status optimus-manager.service
× optimus-manager.service - Optimus Manager Commands Daemon
     Loaded: loaded (/usr/lib/systemd/system/optimus-manager.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Mon 2024-06-10 14:11:07 IST; 1min 11s ago
   Duration: 37ms
    Process: 546 ExecStartPre=/usr/bin/python3 -u -m optimus_manager.hooks.pre_daemon_start (code=exited, status=1/FAILURE)
    Process: 570 ExecStartPre=/usr/bin/python3 -u -m optimus_manager.hooks.pre_xorg_start (code=exited, status=1/FAILURE)
    Process: 574 ExecStart=/usr/bin/python3 -u -m optimus_manager.daemon (code=exited, status=1/FAILURE)
    Process: 578 ExecStopPost=/usr/bin/python3 -u -m optimus_manager.hooks.post_daemon_stop (code=exited, status=1/FAILURE)
   Main PID: 574 (code=exited, status=1/FAILURE)
        CPU: 193ms

Jun 10 14:11:06 archlinux systemd[1]: Starting Optimus Manager Commands Daemon...
Jun 10 14:11:07 archlinux python3[546]: /usr/bin/python3: Error while finding module specification for 'optimus_manager.hooks.pre_daemon_start' (ModuleNotFoundError: No module named 'optimus_manager')
Jun 10 14:11:07 archlinux python3[570]: /usr/bin/python3: Error while finding module specification for 'optimus_manager.hooks.pre_xorg_start' (ModuleNotFoundError: No module named 'optimus_manager')
Jun 10 14:11:07 archlinux systemd[1]: Started Optimus Manager Commands Daemon.
Jun 10 14:11:07 archlinux python3[574]: /usr/bin/python3: Error while finding module specification for 'optimus_manager.daemon' (ModuleNotFoundError: No module named 'optimus_manager')
Jun 10 14:11:07 archlinux systemd[1]: optimus-manager.service: Main process exited, code=exited, status=1/FAILURE
Jun 10 14:11:07 archlinux python3[578]: /usr/bin/python3: Error while finding module specification for 'optimus_manager.hooks.post_daemon_stop' (ModuleNotFoundError: No module named 'optimus_manager')
Jun 10 14:11:07 archlinux systemd[1]: optimus-manager.service: Control process exited, code=exited, status=1/FAILURE
Jun 10 14:11:07 archlinux systemd[1]: optimus-manager.service: Failed with result 'exit-code'.
stevanovics commented 3 months ago

Had the same issue. Switching to optimus-manager-git and rebooting fixed it for me.

nwildner commented 3 months ago

Optimus manager is not the only software. There are other softwares written in python that had those issues, specially when updating versions. I had that very same issue on optimus-manager when updating from 3.11 to 3.12.

You should be fine after reinstalling optimus-manager.

CodePurble commented 3 months ago

Yep, switching to optimus-manager-git fixes the issue. Thanks for the help everyone!