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

Windows 10: All plugins fail to initialise #1793

Closed
TomBrien opened this issue Jan 12, 2021 · 2 comments
Closed

Windows 10: All plugins fail to initialise #1793

TomBrien opened this issue Jan 12, 2021 · 2 comments
Labels

Comments

@TomBrien
Copy link

Describe the bug
Running on Win10, Python 3.9 (also tested with 3.8) fails with all modules reporting they fail to initialise. When running the web server (-w) it hangs at the splash page, the console output is:

angular.js:15570 TypeError: Cannot read property 'os_name' of undefined
    at stats.js:22
    at processQueue (angular.js:17948)
    at angular.js:17996
    at Scope.$digest (angular.js:19115)
    at Scope.$apply (angular.js:19503)
    at done (angular.js:13346)
    at completeRequest (angular.js:13603)
    at XMLHttpRequest.requestLoaded (angular.js:13508) "Possibly unhandled rejection: {}"

Running glances -w returns:

Error while initializing the alert plugin (invalid syntax (parser.py, line 15))
Error while initializing the amps plugin (invalid syntax (parser.py, line 15))
Error while initializing the cloud plugin (invalid syntax (parser.py, line 15))
Error while initializing the connections plugin (invalid syntax (parser.py, line 15))
Error while initializing the core plugin (invalid syntax (parser.py, line 15))
Error while initializing the cpu plugin (invalid syntax (parser.py, line 15))
Error while initializing the diskio plugin (invalid syntax (parser.py, line 15))
Error while initializing the docker plugin (invalid syntax (parser.py, line 15))
Error while initializing the folders plugin (invalid syntax (parser.py, line 15))
Error while initializing the fs plugin (invalid syntax (parser.py, line 15))
Error while initializing the gpu plugin (invalid syntax (parser.py, line 15))
Error while initializing the help plugin (invalid syntax (parser.py, line 15))
Error while initializing the ip plugin (invalid syntax (parser.py, line 15))
Error while initializing the irq plugin (invalid syntax (parser.py, line 15))
Error while initializing the load plugin (invalid syntax (parser.py, line 15))
Error while initializing the mem plugin (invalid syntax (parser.py, line 15))
Error while initializing the memswap plugin (invalid syntax (parser.py, line 15))
Error while initializing the network plugin (invalid syntax (parser.py, line 15))
Error while initializing the now plugin (invalid syntax (parser.py, line 15))
Error while initializing the percpu plugin (invalid syntax (parser.py, line 15))
Error while initializing the ports plugin (invalid syntax (parser.py, line 15))
Error while initializing the processcount plugin (invalid syntax (parser.py, line 15))
Error while initializing the processlist plugin (invalid syntax (parser.py, line 15))
Error while initializing the psutilversion plugin (invalid syntax (parser.py, line 15))
Error while initializing the quicklook plugin (invalid syntax (parser.py, line 15))
Error while initializing the raid plugin (invalid syntax (parser.py, line 15))
Error while initializing the sensors plugin (invalid syntax (parser.py, line 15))
Error while initializing the smart plugin (invalid syntax (parser.py, line 15))
Error while initializing the system plugin (invalid syntax (parser.py, line 15))
Error while initializing the uptime plugin (invalid syntax (parser.py, line 15))
Error while initializing the wifi plugin (invalid syntax (parser.py, line 15))
Glances Web User Interface started on http://0.0.0.0:61208/

Running just glances gives:

Error while initializing the alert plugin (invalid syntax (parser.py, line 15))
Error while initializing the amps plugin (invalid syntax (parser.py, line 15))
Error while initializing the psutilversion plugin (invalid syntax (parser.py, line 15))
Error while initializing the quicklook plugin (invalid syntax (parser.py, line 15))
Error while initializing the raid plugin (invalid syntax (parser.py, line 15))
Error while initializing the sensors plugin (invalid syntax (parser.py, line 15))
Error while initializing the smart plugin (invalid syntax (parser.py, line 15))
Error while initializing the system plugin (invalid syntax (parser.py, line 15))
Error while initializing the uptime plugin (invalid syntax (parser.py, line 15))
Error while initializing the wifi plugin (invalid syntax (parser.py, line 15))
Traceback (most recent call last):
  File "c:\python39\python-3.9.0.amd64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\python-3.9.0.amd64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python39\python-3.9.0.amd64\Scripts\glances.exe\__main__.py", line 7, in <module>
  File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\__init__.py", line 143, in main
    start(config=config, args=args)
  File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\__init__.py", line 112, in start
    mode.serve_forever()
  File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\standalone.py", line 154, in serve_forever
    loop = self.__serve_forever()
  File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\standalone.py", line 141, in __serve_forever
    ret = not self.screen.update(self.stats, duration=adapted_refresh)
  File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\outputs\glances_curses.py", line 966, in update
    self.flush(stats, cs_status=cs_status)
  File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\outputs\glances_curses.py", line 941, in flush
    self.display(stats, cs_status=cs_status)
  File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\outputs\glances_curses.py", line 542, in display
    __stat_display["processlist"] = stats.get_plugin(
AttributeError: 'NoneType' object has no attribute 'get_stats_display'

To Reproduce
Steps to reproduce the behavior:

  1. pip install glances or pip install 'glances[action,browser,cloud,cpuinfo,docker,export,folders,gpu,graph,ip,raid,snmp,web,wifi]' seem to make no difference
  2. pip install --upgrade psutil
  3. pip install windows-curses
  4. glances -w

Expected behavior
A clear and concise description of what you expected to happen.
Glances to run without error and be available on the above port

Desktop (please complete the following information):

  • OS: [e.g. GNU/Linux Ubuntu 20.04]
    Windows 10 Pro 20H2 (19042.685)
  • Glances Version [output of glances -V]
    Glances v3.1.5 with PsUtil v5.8.0
  • Glances logs file [output of tail -10 , truncated but essentially seeing this for each plugin
    glances.zip
2021-01-12 21:29:50,807 -- CRITICAL -- Error while initializing the uptime plugin (invalid syntax (parser.py, line 15))
2021-01-12 21:29:50,807 -- ERROR -- Traceback (most recent call last):
File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\stats.py", line 118, in _load_plugin
  plugin = __import__(plugin_script[:-3])
File "C:\Python39\python-3.9.0.amd64\Lib\site-packages\glances\plugins\glances_uptime.py", line 24, in <module>
  from glances.plugins.glances_plugin import GlancesPlugin
File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\plugins\glances_plugin.py", line 32, in <module>
  from glances.actions import GlancesActions
File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\actions.py", line 28, in <module>
  import pystache
File "c:\python39\python-3.9.0.amd64\lib\site-packages\pystache\__init__.py", line 9, in <module>
  from pystache.init import parse, render, Renderer, TemplateSpec
File "c:\python39\python-3.9.0.amd64\lib\site-packages\pystache\init.py", line 8, in <module>
  from pystache.parser import parse
File "c:\python39\python-3.9.0.amd64\lib\site-packages\pystache\parser.py", line 15
  NON_BLANK_RE = re.compile(ur'^(.)', re.M)
                              ^
SyntaxError: invalid syntax

2021-01-12 21:29:50,810 -- CRITICAL -- Error while initializing the wifi plugin (invalid syntax (parser.py, line 15))
2021-01-12 21:29:50,811 -- ERROR -- Traceback (most recent call last):
File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\stats.py", line 118, in _load_plugin
  plugin = __import__(plugin_script[:-3])
File "C:\Python39\python-3.9.0.amd64\Lib\site-packages\glances\plugins\glances_wifi.py", line 26, in <module>
  from glances.plugins.glances_plugin import GlancesPlugin
File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\plugins\glances_plugin.py", line 32, in <module>
  from glances.actions import GlancesActions
File "c:\python39\python-3.9.0.amd64\lib\site-packages\glances\actions.py", line 28, in <module>
  import pystache
File "c:\python39\python-3.9.0.amd64\lib\site-packages\pystache\__init__.py", line 9, in <module>
  from pystache.init import parse, render, Renderer, TemplateSpec
File "c:\python39\python-3.9.0.amd64\lib\site-packages\pystache\init.py", line 8, in <module>
  from pystache.parser import parse
File "c:\python39\python-3.9.0.amd64\lib\site-packages\pystache\parser.py", line 15
  NON_BLANK_RE = re.compile(ur'^(.)', re.M)
                              ^
SyntaxError: invalid syntax

2021-01-12 21:29:50,817 -- INFO -- Glances RESTful API Server started on http://0.0.0.0:61208/api/3/
2021-01-12 21:29:50,819 -- INFO -- Glances Web User Interface started on http://0.0.0.0:61208/
2021-01-12 21:34:13,302 -- INFO -- Start Glances 3.1.5
2021-01-12 21:34:13,302 -- INFO -- CPython 3.9.0 and psutil 5.8.0 detected

Additional context
Add any other context about the problem here.

@TomBrien TomBrien changed the title Will not run on Win10 Windows 10: All plugins fail to initialise Jan 12, 2021
@nicolargo
Copy link
Owner

Hi, @TomBrien

the errors cames from the PyStache lib ==> defunkt/pystache#181

It should be solve if you install pystache from Pip (read defunkt/pystache#208 (comment)).

@TomBrien
Copy link
Author

@nicolargo thanks for that. PyStache was installed but reading the links it looks like it relies on lib2to3 to work in Python 3 and there are issues with 2to3 which is noted to be unstable with Python 3.9 and deprecated in 3.10. Any way fixed by running:
python -m lib2to3 --write --nobackups --no-diffs "FULL/PATH/TO/pystache".

Thanks for the pointers :)

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

No branches or pull requests

2 participants