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

Missing Dependencies for Web Mode When Installing Glances with Homebrew #3016

Closed
gromdimon opened this issue Nov 15, 2024 · 3 comments
Closed

Comments

@gromdimon
Copy link

Describe the bug
The problem occurs when installing Glances through Homebrew on macOS: essential dependencies required for running Glances in web server mode (glances -w) are not installed automatically. When trying to start web mode, an import error appears because FastAPI, Uvicorn, and Jinja2 are missing. This requires manual installation of these dependencies in the specific Python environment Glances uses, which should ideally be handled during installation.

To Reproduce

  1. Install Glances via Homebrew:
brew install glances
  1. Try starting Glances in web server mode:
glances -w
  1. You will encounter an error similar to:
FastAPI import error: No module named 'fastapi'
Glances cannot start in web server mode.

Expected behavior
Glances should automatically install the necessary dependencies for web mode (fastapi, uvicorn, jinja2) when using brew install glances so that glances -w runs without error after installation.

Environement (please complete the following information)

  • Operating System (lsb_release -a or OS name/version):
ProductName:		macOS
ProductVersion:		15.0.1
BuildVersion:		24A348
  • Glances & psutil versions: To be completed with result of: glances -V
Glances version:	4.2.1
Glances API version:	4
PsUtil version:		6.1.0
  • How do you install Glances (Pypi package, script, package manager, source): To be completed
brew install glances
  • Glances test: To be completed with result of: glances --issue
glances --issue
===============================================================================
Glances 4.2.1 (/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/__init__.py)
Python 3.13.0 (/opt/homebrew/Cellar/glances/4.2.1/libexec/bin/python)
PsUtil 6.1.0 (/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/psutil/__init__.py)
===============================================================================
alert         [OK]    0.00003s 
[]
amps          [OK]    0.00010s 
[]
cloud         [OK]    0.00004s 
{}
connections   [OK]    0.00224s 
{'net_connections_enabled': False, 'nf_conntrack_enabled': True}
containers    [OK]    0.00003s 
{}
core          [OK]    0.00004s 
{'log': 8, 'phys': 8}
cpu           [OK]    0.00022s 
{'cpucore': 8,
'ctx_switches': 0,
'ctx_switches_gauge': 13507,
'idle': 97.1,
'interrupts': 0,
'interrupts_gauge': 82545,
'nice': 0.0,
'soft_interrupts': 0,
'soft_interrupts_gauge': 16375290,
'syscalls': 0,
'syscalls_gauge': 120500,
'system': 1.3,
'time_since_update': 2.0582940578460693,
'total': 2.9,
'user': 1.6}
diskio        [OK]    0.00099s key=disk_name 
[{'disk_name': 'disk0',
 'key': 'disk_name',
 'read_bytes': 0,
 'read_bytes_gauge': 104481124352,
 'read_count': 0,
 'read_count_gauge': 3948962,
 'time_since_update': 2.059825897216797,
 'write_bytes': 0,
 'write_bytes_gauge': 34578247680,
 'write_count': 0,
 'write_count_gauge': 1107947}, ...]
folders       [OK]    0.00003s 
[]
fs            [OK]    0.00059s key=mnt_point 
[{'device_name': '/dev/disk3s1s1',
 'free': 113901592576,
 'fs_type': 'apfs',
 'key': 'mnt_point',
 'mnt_point': '/',
 'percent': 11.2,
 'size': 245107195904,
 'used': 14418989056}, ...]
gpu           [OK]    0.00004s 
[]
help          [OK]    0.00000s 
None
ip            [OK]    0.00002s 
{}
irq           [OK]    0.00002s 
[]
load          [OK]    0.00004s 
{'cpucore': 8, 'min1': 1.84423828125, 'min15': 1.57470703125, 'min5': 1.66748046875}
mem           [OK]    0.00006s 
{'active': 2128216064,
'available': 2195668992,
'free': 2195668992,
'inactive': 1975255040,
'percent': 74.4,
'total': 8589934592,
'used': 6394265600,
'wired': 1366261760}
memswap       [OK]    0.00006s 
{'free': 1552023552,
'percent': 27.7,
'sin': 52574961664,
'sout': 762445824,
'time_since_update': 2.062190055847168,
'total': 2147483648,
'used': 595460096}
network       [OK]    0.00189s key=interface_name 
[{'alias': None,
 'bytes_all': 0,
 'bytes_all_gauge': 5648384,
 'bytes_all_rate_per_sec': 0.0,
 'bytes_recv': 0,
 'bytes_recv_gauge': 2824192,
 'bytes_recv_rate_per_sec': 0.0,
 'bytes_sent': 0,
 'bytes_sent_gauge': 2824192,
 'bytes_sent_rate_per_sec': 0.0,
 'interface_name': 'lo0',
 'key': 'interface_name',
 'speed': 0,
 'time_since_update': 2.0128469467163086}, ...]
now           [OK]    0.00004s 
{'custom': '2024-11-15 12:28:56 +07', 'iso': '2024-11-15T12:28:56+07:00'}
percpu        [OK]    0.00022s key=cpu_number 
[{'cpu_number': 0,
 'dpc': None,
 'guest': None,
 'guest_nice': None,
 'idle': 92.7,
 'interrupt': None,
 'iowait': None,
 'irq': None,
 'key': 'cpu_number',
 'nice': 0.0,
 'softirq': None,
 'steal': None,
 'system': 3.9,
 'total': 7.3,
 'user': 3.4}, ...]
ports         [OK]    0.00026s 
[]
processcount  [OK]    0.04004s 
{'pid_max': 0, 'running': 569, 'sleeping': 0, 'thread': 1679, 'total': 569}
processlist   [OK]    0.00016s 
[]
psutilversion [OK]    0.00001s 
'6.1.0'
quicklook     [OK]    0.00006s 
{'cpu': 2.9,
'cpu_hz': 3504000000.0,
'cpu_hz_current': 3504000000.0,
'cpu_log_core': 8,
'cpu_name': 'CPU',
'cpu_phys_core': 8,
'load': 19.7,
'mem': 74.6,
'percpu': [{...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}],
'swap': 27.7}
raid          [OK]    0.00001s 
{}
sensors       [OK]    0.00000s key=label 
[{'key': 'label',
 'label': 'Battery',
 'status': 'Charging',
 'type': <SensorType.BATTERY: 'battery'>,
 'unit': '%',
 'value': 93}, ...]
smart         [NA]
system        [OK]    0.00000s 
{'hostname': 'Dzmitrys-MacBook-Air.local',
'hr_name': 'Darwin 15.0.1 64bit',
'os_name': 'Darwin',
'os_version': '15.0.1',
'platform': '64bit'}
uptime        [OK]    0.00002s 
{'seconds': 16408}
version       [OK]    0.00001s 
'4.2.1'
vms           [OK]    0.00002s 
[]
wifi          [OK]    0.00001s 
[]
===============================================================================
Total time to update all stats: 0.04961s
===============================================================================
@nicolargo
Copy link
Owner

Hi @gromdimon

i close this issue because it is duplicated as #3012

@gromdimon
Copy link
Author

@nicolargo, thank you for the quick response! Apologies for opening the duplicate issues (I didn’t check the closed tickets, as the bug didn’t seem to be fixed).

@nicolargo
Copy link
Owner

No problem. Hope thé bug will be fixed by the package manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants