AdnanHodzic / auto-cpufreq

Automatic CPU speed & power optimizer for Linux
https://foolcontrol.org/?p=4603
GNU Lesser General Public License v3.0
5.32k stars 259 forks source link

Getting TypeError when executing after installation #715

Closed doehr closed 1 month ago

doehr commented 1 month ago

Hi all,

I've used the snap package of auto-cpufreq for some time. Today I uninstalled the snap package and used the recommended installation method:

git clone https://github.com/AdnanHodzic/auto-cpufreq.git cd auto-cpufreq && sudo ./auto-cpufreq-installer

When running

auto-cpufreq

after installation I get the following error:

Traceback (most recent call last):
  File "/opt/auto-cpufreq/venv/bin/auto-cpufreq", line 5, in <module>
    from auto_cpufreq.bin.auto_cpufreq import main
  File "/opt/auto-cpufreq/venv/lib/python3.8/site-packages/auto_cpufreq/bin/auto_cpufreq.py", line 15, in <module>
    from auto_cpufreq.core import *
  File "/opt/auto-cpufreq/venv/lib/python3.8/site-packages/auto_cpufreq/core.py", line 29, in <module>
    from auto_cpufreq.utils.config import config
  File "/opt/auto-cpufreq/venv/lib/python3.8/site-packages/auto_cpufreq/utils/config.py", line 8, in <module>
    def find_config_file(args_config_file: str | None) -> str:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Uninstalling, rebooting and reinstalling was not successful. Any hints on how I can fix this issue? Huge thanks in advance.

Angel-Karasu commented 1 month ago

What is your python version ? To found it run python --version

Hi all,

I've used the snap package of auto-cpufreq for some time. Today I uninstalled the snap package and used the recommended installation method:

git clone https://github.com/AdnanHodzic/auto-cpufreq.git cd auto-cpufreq && sudo ./auto-cpufreq-installer

When running

auto-cpufreq

after installation I get the following error:

Traceback (most recent call last): File "/opt/auto-cpufreq/venv/bin/auto-cpufreq", line 5, in from auto_cpufreq.bin.auto_cpufreq import main File "/opt/auto-cpufreq/venv/lib/python3.8/site-packages/auto_cpufreq/bin/auto_cpufreq.py", line 15, in from auto_cpufreq.core import * File "/opt/auto-cpufreq/venv/lib/python3.8/site-packages/auto_cpufreq/core.py", line 29, in from auto_cpufreq.utils.config import config File "/opt/auto-cpufreq/venv/lib/python3.8/site-packages/auto_cpufreq/utils/config.py", line 8, in def find_config_file(args_config_file: str | None) -> str: TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Uninstalling, rebooting and reinstalling was not successful. Any hints on how I can fix this issue? Huge thanks in advance.

doehr commented 1 month ago

What is your python version ? To found it run python --version

Thanks for the quick reply. I get the following error:

bash: python: command not found

The following python versions are installed

python2           python3           python3.8         python3-config
python2.7         python3.13        python3.8-config  
Angel-Karasu commented 1 month ago

What is your python version ? To found it run python --version

Thanks for the quick reply. I get the following error:

bash: python: command not found

The following python versions are installed

python2 python3 python3.8 python3-config python2.7 python3.13 python3.8-config

Try python3 --version What is your distribution ?

doehr commented 1 month ago

The Python version is:

Python 3.8.10

I use the following distribution:

  Operating System: Linux Mint 20
            Kernel: Linux 5.4.0-182-generic
      Architecture: x86-64
Angel-Karasu commented 1 month ago

Try to run sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.13 1 and retry to run auto-cpufreq It forces to use python 3.13 instead python 3.8

doehr commented 1 month ago

I tried. Unfortunately it didn't work...

Angel-Karasu commented 1 month ago

Try to run : sudo update-alternatives --install $(which python3) python $(which python3.13) 1 And show the python version: python3 --version If the version is still 3.8, the bug will persist, otherwise you can to reinstall and run auto-cpufreq.

Angel-Karasu commented 1 month ago

The correction has been applied, wait until it is merged with the main branch or if you don't went to wait you can run git clone -b origin https://github.com/Angel-Karasu/auto-cpufreq.git and follow the installation

doehr commented 1 month ago

Hi, I upgraded to the latest Linux Mint version 21.3 and did a reinstall. Everything seems to work now. Thank you for you support!

Angel-Karasu commented 4 weeks ago

PR #716 is merged which should fix the issue, if problem persists, please feel free to re-open it