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

Getting TypeError when executing after installation #715

Closed
doehr opened this issue May 31, 2024 · 10 comments · Fixed by #716
Closed

Getting TypeError when executing after installation #715

doehr opened this issue May 31, 2024 · 10 comments · Fixed by #716

Comments

@doehr
Copy link

doehr commented May 31, 2024

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
Copy link
Contributor

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
Copy link
Author

doehr commented May 31, 2024

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
Copy link
Contributor

Angel-Karasu commented May 31, 2024

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
Copy link
Author

doehr commented May 31, 2024

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
Copy link
Contributor

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
Copy link
Author

doehr commented May 31, 2024

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

@Angel-Karasu
Copy link
Contributor

Angel-Karasu commented Jun 1, 2024

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
Copy link
Contributor

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
Copy link
Author

doehr commented Jun 1, 2024

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!

@doehr doehr closed this as completed Jun 1, 2024
AdnanHodzic pushed a commit that referenced this issue Jun 7, 2024
* Remove | in type

* Repare battery read problem

* Compatible with many arguments
@Angel-Karasu
Copy link
Contributor

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

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

Successfully merging a pull request may close this issue.

2 participants