nicolargo / glances

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
http://nicolargo.github.io/glances/
Other
26.64k stars 1.53k forks source link

Glances silently fails on Windows 11 #2689

Closed ajgringo619 closed 3 months ago

ajgringo619 commented 7 months ago

Fairly new Windows 11 Home installation, using pyenv-win to create my virtual environments. When I run glances from a PowerShell terminal, it starts then stops with no screen output. Here's the log entries from the most recent attempt:

2024-03-03 08:56:16,609 -- WARNING -- PsUtil can not grab processes gids ('Process' object has no attribute 'gids')
2024-03-03 08:56:16,610 -- INFO -- Start Glances 3.4.0.3
2024-03-03 08:56:16,610 -- INFO -- CPython 3.12.1 (C:\Users\ajgri\.venv\work-3.12.1\Scripts\python.exe) and psutil 5.9.8 detected
2024-03-03 08:56:16,626 -- INFO -- Start GlancesStandalone mode
2024-03-03 08:56:16,631 -- WARNING -- Missing Python Lib (No module named 'requests'), Cloud plugin is disabled
2024-03-03 08:56:16,634 -- WARNING -- Error loading Docker deps Lib. Docker plugin is disabled (No module named 'requests')
2024-03-03 08:56:16,635 -- WARNING -- Error loading Podman deps Lib. Podman feature in the Containers plugin is disabled (No module named 'podman')
2024-03-03 08:56:16,640 -- WARNING -- Missing Python Lib (No module named 'py3nvml'), Nvidia GPU plugin is disabled
2024-03-03 08:56:16,641 -- WARNING -- Missing Python Lib (No module named 'netifaces'), IP plugin is disabled
2024-03-03 08:56:16,656 -- WARNING -- Missing Python Lib (No module named 'requests'), Ports plugin is limited to port scanning
2024-03-03 08:56:16,661 -- WARNING -- Sparklines module not found (No module named 'sparklines')
2024-03-03 08:56:16,662 -- WARNING -- Missing Python Lib (No module named 'pymdstat'), Raid plugin is disabled
2024-03-03 08:56:16,665 -- WARNING -- Missing Python Lib (No module named 'pySMART'), HDD Smart plugin is disabled
2024-03-03 08:56:16,670 -- WARNING -- Missing Python Lib (No module named 'wifi'), Wifi plugin is disabled
2024-03-03 08:56:16,670 -- WARNING -- Wifi lib is not compliant with Python 3, Wifi plugin is disabled
2024-03-03 08:56:16,672 -- WARNING -- Can not get network connections track ([Errno 2] No such file or directory: '/proc/sys/net/netfilter/nf_conntrack_count')
2024-03-03 08:56:16,673 -- INFO -- Disable connections track

I installed it via pip as I've always done: pip install glances windows-curses. I've tried disabling modules, but that hasn't helped either. Here's the list of installed modules:

Package           Version
----------------- -------
asttokens         2.4.1
colorama          0.4.6
decorator         5.1.1
defusedxml        0.7.1
executing         2.0.1
Glances           3.4.0.3
ipython           8.22.1
jedi              0.19.1
matplotlib-inline 0.1.6
packaging         23.2
parso             0.8.3
pip               24.0
prompt-toolkit    3.0.43
psutil            5.9.8
pure-eval         0.2.2
Pygments          2.17.2
six               1.16.0
speedtest-cli     2.1.3
stack-data        0.6.3
traitlets         5.14.1
ujson             5.9.0
wcwidth           0.2.13
windows-curses    2.3.2

Since I'm running as a standard user account, I tried again as an administrator - same results. What am I missing?

nicolargo commented 7 months ago

Never tested on Windows 11.

Can you please copy/paste the result of:

glances --issue

Thanks !

ajgringo619 commented 7 months ago

As requested:

===============================================================================
Glances 3.4.0.3 (C:\Users\ajgri\.venv\work-3.12.1\Lib\site-packages\glances\__init__.py)
Python 3.12.1 (C:\Users\ajgri\.venv\work-3.12.1\Scripts\python.exe)
PsUtil 5.9.8 (C:\Users\ajgri\.venv\work-3.12.1\Lib\site-packages\psutil\__init__.py)
===============================================================================
alert         [OK]    0.00000s
[]
amps          [OK]    0.00000s
[]
cloud         [OK]    0.00000s
{}
connections   [OK]    0.00407s
{'ESTABLISHED': 60,
 'LISTEN': 30,
 'SYN_RECV': 0,
 'SYN_SENT': 0,
 'initiated': 0,
 'net_connections_enabled': True,
 'nf_conntrack_enabled': False,
 'terminated': 0}
containers    [OK]    0.00000s
[]
core          [OK]    0.00000s
{'log': 16, 'phys': 10}
cpu           [OK]    0.00000s
{'cpucore': 16,
 'ctx_switches': 36058,
 'dpc': 0.0,
 'idle': 97.7,
 'interrupt': 0.1,
 'interrupts': 45097,
 'soft_interrupts': 0,
 'syscalls': 123341,
 'system': 1.4,
 'time_since_update': 3.194385290145874,
 'total': 2.3,
 'user': 0.9}
diskio        [OK]    0.00000s key=disk_name
[{'disk_name': 'PhysicalDrive0',
  'key': 'disk_name',
  'read_bytes': 0,
  'read_count': 0,
  'time_since_update': 3.1953201293945312,
  'write_bytes': 536576,
  'write_count': 15}, ...]
folders       [OK]    0.00000s
[]
fs            [OK]    0.00112s key=mnt_point
[{'device_name': 'C:\\',
  'free': 435196215296,
  'fs_type': 'NTFS',
  'key': 'mnt_point',
  'mnt_point': 'C:\\',
  'percent': 56.4,
  'size': 999242592256,
  'used': 564046376960}, ...]
gpu           [OK]    0.00000s
[]
help          [OK]    0.00000s
None
ip            [OK]    0.00000s
{}
irq           [OK]    0.00000s
[]
load          [OK]    0.00000s
{'cpucore': 16, 'min1': 0.0, 'min15': 0.0, 'min5': 0.0}
mem           [OK]    0.00396s
{'available': 23681118208, 'free': 23681118208, 'percent': 30.7, 'total': 34164097024, 'used': 10482978816}
memswap       [OK]    0.00300s
{'free': 2147483648,
 'percent': 0.0,
 'sin': 0,
 'sout': 0,
 'time_since_update': 3.199291229248047,
 'total': 2147483648,
 'used': 0}
network       [OK]    0.00800s key=interface_name
[{'alias': None,
  'cumulative_cx': 137083996,
  'cumulative_rx': 128795934,
  'cumulative_tx': 8288062,
  'cx': 1033351,
  'interface_name': 'vEthernet (ExternalSwitch)',
  'is_up': True,
  'key': 'interface_name',
  'rx': 1005014,
  'speed': 1259339776,
  'time_since_update': 3.2022881507873535,
  'tx': 28337}, ...]
now           [OK]    0.00000s
'2024-03-04 08:55:58 -0800'
percpu        [OK]    0.00000s key=cpu_number
[{'cpu_number': 0, 'idle': 94.2, 'key': 'cpu_number', 'system': 5.3, 'total': 5.8, 'user': 0.0}, ...]
ports         [OK]    0.00100s
[]
processcount  [OK]    1.16900s
{'pid_max': 0, 'running': 267, 'sleeping': 0, 'thread': 4149, 'total': 271}
processlist   [OK]    0.00000s key=pid
[{'cmdline': ['C:\\Users\\ajgri\\.pyenv\\pyenv-win\\versions\\3.12.1\\python.exe',
              'C:\\Users\\ajgri\\.venv\\work-3.12.1\\Scripts\\glances.exe', '--issue'],
  'cpu_percent': 23.0,
  'cpu_times': pcputimes(user=0.0625, system=1.859375, children_user=0.0, children_system=0.0),
  'io_counters': [5327163, 2869, 5327163, 2646, 1],
  'key': 'pid',
  'memory_info': pmem(rss=42082304, vms=30072832, num_page_faults=25028, peak_wset=42143744, wset=42082304, peak_paged_pool=220720, paged_pool=195696, peak_nonpaged_pool=164464, nonpaged_pool=21104, pagefile=30072832, peak_pagefile=30240768, private=30072832),
  'memory_percent': 0.12317698304871785,
  'name': 'python.exe',
  'nice': <Priority.NORMAL_PRIORITY_CLASS: 32>,
  'num_threads': 8,
  'pid': 7864,
  'status': 'R',
  'time_since_update': 3.2022905349731445,
  'username': 'DSS-WINDOWS\\ajgri'}, ...]
psutilversion [OK]    0.00000s
(5, 9, 8)
quicklook     [OK]    0.00398s
{'cpu': 2.3,
 'cpu_hz': 2500000000.0,
 'cpu_hz_current': 2500000000.0,
 'cpu_name': 'CPU',
 'mem': 30.6,
 'percpu': [{...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...},
            {...}],
 'swap': 0.0}
raid          [OK]    0.00000s
{}
sensors       [OK]    2.01802s key=label
[{'key': 'label', 'label': 'Battery', 'status': 'Charging', 'type': 'battery', 'unit': '%', 'value': 100}, ...]
smart         [NA]
system        [OK]    0.00100s
{'hostname': 'dss-windows',
 'hr_name': 'Windows 11 SP0 64bit',
 'os_name': 'Windows',
 'os_version': '11 SP0',
 'platform': '64bit'}
uptime        [OK]    0.00000s
{'seconds': 719}
wifi          [OK]    0.00000s
[]
===============================================================================
Total time to update all stats: 3.23070s
===============================================================================
nicolargo commented 7 months ago

Stats looks ok, the issue may come from the Curses lib.

Is anyone run Glances in standalone/Curses interface on Windows 11 ?

DarryDoo commented 7 months ago

Fails in standalone starting from PowerShell or Command Prompt. Works in Server mode. Windows 11 Pro in a Proxmox VM. My --issue and --debug log looks very similar to above.

Tomasz-Marciniak commented 6 months ago

Windows curses initscr() in 3.12 just fails. Nothing more. Does not log any exception and exits. Thats it.

Not sure if the problem is with curses itself or python 3.12.

I have managed to run glances after installing python curses from https://github.com/cgohlke/python-curses-build/releases but no colours and cannot exit (CTRL+C and so on does not work).

@nicolargo - Hope 3.13 will fix it. I tried to recompile glances with workarounds found in web. I'm a rookie in python so maybe you will figure it out but glances have no issue, this is python or curses fault.

nicolargo commented 6 months ago

Related to: https://github.com/zephyrproject-rtos/windows-curses/issues/50#issuecomment-1835851654

ajgringo619 commented 6 months ago

Wow - I never thought to try another version of Python. Python 3.10.11 is working as expected.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 3 months with no activity.

RazCrimson commented 3 months ago

Closing as upstream issue fixed.