glances icon indicating copy to clipboard operation
glances copied to clipboard

Glances web server fails to start on windows 11.

Open Hzipp opened this issue 9 months ago • 8 comments

Describe the bug Glances web server fails to start on windows 11.

I have already tried the mentioned solution from here: #3101

C:\Python313\Scripts>pip uninstall netifaces
WARNING: Skipping netifaces as it is not installed.

C:\Python313\Scripts>pip install netifaces2
Requirement already satisfied: netifaces2 in c:\python313\lib\site-packages (0.0.22)

C:\Python313\Scripts>glances.exe -w
Glances Web User Interface started on http://0.0.0.0:61208/
Glances RESTful API Server started on http://0.0.0.0:61208/api/4
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python313\Scripts\glances.exe\__main__.py", line 7, in <module>
    sys.exit(main())
             ~~~~^^
  File "C:\Python313\Lib\site-packages\glances\__init__.py", line 173, in main
    start(config=core.get_config(), args=core.get_args())
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python313\Lib\site-packages\glances\__init__.py", line 102, in start
    mode = GlancesMode(config=config, args=args)
  File "C:\Python313\Lib\site-packages\glances\webserver.py", line 35, in __init__
    self.web = GlancesRestfulApi(config=config, args=args)
               ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python313\Lib\site-packages\glances\outputs\glances_restful_api.py", line 165, in __init__
    self.autodiscover_client = GlancesAutoDiscoverClient(socket.gethostname().split('.', 1)[0], self.args)
                               ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python313\Lib\site-packages\glances\servers_list_dynamic.py", line 196, in __init__
    zeroconf_bind_address = self.find_active_ip_address()
  File "C:\Python313\Lib\site-packages\glances\servers_list_dynamic.py", line 247, in find_active_ip_address
    gateway_itf = netifaces.gateways()[netifaces.AF_INET][0][1]
                  ~~~~~~~~~~~~~~~~~~^^
  File "C:\Python313\Lib\site-packages\netifaces\__init__.py", line 232, in gateways
    raise NotImplementedError("No implementation for `gateways()` yet")
NotImplementedError: No implementation for `gateways()` yet

Hzipp avatar Feb 23 '25 20:02 Hzipp

FWIW the opposite of that solution has been working for me. I.e. glances installs netifaces2 but actually only works with netifaces:

pip uninstall netifaces2
pip install netifaces

But I would love to not have to do that, +1 :)

andreyryabtsev avatar Feb 24 '25 03:02 andreyryabtsev

Related issues:

  • https://github.com/nicolargo/glances/issues/3072
  • https://github.com/nicolargo/glances/issues/3055

nicolargo avatar Feb 24 '25 16:02 nicolargo

FWIW the opposite of that solution has been working for me. I.e. glances installs netifaces2 but actually only works with netifaces:

pip uninstall netifaces2
pip install netifaces

But I would love to not have to do that, +1 :)

I tried it the other way around, but that didn’t work for me either. :(

Hzipp avatar Feb 26 '25 14:02 Hzipp

Can i do anything to help with the test or with the investigation of this?

Hzipp avatar Mar 04 '25 11:03 Hzipp

I am having the same exact issue too... Only the webserver version is not working. Glances in terminal works fine.

TheRealFalseReality avatar Mar 13 '25 15:03 TheRealFalseReality

pip uninstall netifaces2 pip install netifaces-plus This works for me.

overXsky avatar Apr 01 '25 11:04 overXsky

pip uninstall netifaces2 pip install netifaces-plus This works for me.

This works

TheRealFalseReality avatar Apr 01 '25 15:04 TheRealFalseReality

Same problem still occurs in latest version. I have installed everything 'fresh' (all python packages), I updated all and spent hours to solve cause of error.

Python 3.13.3 pip 25.1.1 Glances version: 4.3.1 Glances API version: 4 PsUtil version: 7.0.1

Exactly same error message as one above.

After saw this issue, I uninstalled netifaces2, installed netifaces and then problem solved.

gknzby avatar May 22 '25 21:05 gknzby

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

github-actions[bot] avatar Aug 24 '25 02:08 github-actions[bot]

pip uninstall netifaces2 pip install netifaces-plus

This works for me.

jonathan-zi-wang avatar Sep 08 '25 07:09 jonathan-zi-wang