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

TypeError: load() missing 1 required positional argument: 'Loader' on debian-11 #225

Open
ghost opened this issue Dec 6, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 6, 2021

Python 2.7.18
Version: 2.7.11
Debian GNU/Linux 11 
5.10.0-8-amd64 
Intel(R) Xeon(R) CPU           E5503
server-info --show
Traceback (most recent call last):
  File "/home/net/.local/bin/server-info", line 8, in <module>
    Server().main()
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_hardware/server.py", line 122, in main
    print_(dict2yaml(self.read()))
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_hardware/server.py", line 60, in read
    info[key] = subsystem(datadir=self.directory).parse()
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_hardware/cpu.py", line 28, in parse
    'info': self.read(YAMLLike, 'lscpu_info'),
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_hardware/subsystem.py", line 42, in read
    return func(self.path(filename)).result
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_hardware/parser.py", line 11, in __init__
    self.result = self.parse_file_safe(filepath) if filepath else None
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_hardware/parser.py", line 22, in parse_file_safe
    return self.parse_file(filepath, **kwargs)
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_hardware/parser.py", line 18, in parse_file
    return self.parse(file_for_parse.read().strip(), **kwargs)
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_hardware/parser.py", line 28, in parse
    return yaml.load(text)
TypeError: load() missing 1 required positional argument: 'Loader'
rx-buffers-increase enp1s0f0
Traceback (most recent call last):
  File "/home/net/.local/bin/rx-buffers-increase", line 12, in <module>
    RxBuffersTune()
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_tuning/rx_buffers.py", line 30, in __init__
    self.parse()
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_tuning/rx_buffers.py", line 40, in parse
    self.run_ethtool('-i', 1)
  File "/home/net/.local/lib/python3.9/site-packages/netutils_linux_tuning/rx_buffers.py", line 74, in run_ethtool
    process = Popen(['ethtool', key, self.options.dev], stdout=PIPE, stderr=PIPE)
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ethtool'
 server-info --collect
Consider installing dmidecode:
        yum -y install dmidecode

also network-top shuts after 2-6 seconds.

@rayrapetyan
Copy link

Have you installed dmidecode and ethtool?

sudo apt install dmidecode ethtool

Are you running script as root?

@IgorOhrimenko
Copy link

IgorOhrimenko commented May 18, 2023

root@server:~# apt install dmidecode ethtool
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
dmidecode is already the newest version (3.3-2).
ethtool is already the newest version (1:5.9-1).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

root@server:~# server-info --rate --subsystem
Traceback (most recent call last):
  File "/usr/local/bin/server-info", line 8, in <module>
    Server().main()
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_hardware/server.py", line 124, in main
    print_(dict2yaml(self.rate()))
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_hardware/server.py", line 67, in rate
    info = self.read()
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_hardware/server.py", line 60, in read
    info[key] = subsystem(datadir=self.directory).parse()
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_hardware/net.py", line 17, in parse
    return ReaderNet(self.datadir, self.path).netdevs
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_hardware/net.py", line 122, in __init__
    self.net_dev_list()
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_hardware/net.py", line 163, in net_dev_list
    self.net_dev_list_drivers()
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_hardware/net.py", line 145, in net_dev_list_drivers
    driverdata = YAMLLike().parse_file_safe(driverfile)
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_hardware/parser.py", line 22, in parse_file_safe
    return self.parse_file(filepath, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_hardware/parser.py", line 18, in parse_file
    return self.parse(file_for_parse.read().strip(), **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_hardware/parser.py", line 28, in parse
    return yaml.load(text)
TypeError: load() missing 1 required positional argument: 'Loader'

The problem still here in the last version from pip 2.7.11.

@TTpartizan
Copy link

+1
not run
TypeError: load() missing 1 required positional argument: 'Loader'

@aztec102
Copy link

@TTpartizan
You need to take files from the repository and replace them with the files that are in the library
parser.py
memory.py
disk.py

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