Trying to install glances to pve9 - urllib3 problem

fribse

Member
Feb 2, 2022
9
1
8
57
Hi All

I did a completely painless update from pve 8 to 9 the other day.
Or at least I thought so :)
Now I see that glances that I had installed on the host, is defunct.

So I tried doing a new install on debian 13, but when I do that I get this message:
Code:
  Attempting uninstall: urllib3

    Found existing installation: urllib3 2.3.0
error: uninstall-no-record-file
× Cannot uninstall urllib3 2.3.0
╰─> The package's contents are unknown: no RECORD file was found for urllib3.
hint: The package was installed by debian. You should check if it can uninstall the package.
root@pve:~# apt remove urllib3
Error: Unable to locate package urllib3
root@pve:~# pip uninstall urllib3
Found existing installation: urllib3 2.3.0
error: uninstall-no-record-file
× Cannot uninstall urllib3 2.3.0
╰─> The package's contents are unknown: no RECORD file was found for urllib3.

hint: The package was installed by debian. You should check if it can uninstall the package.

So it complains that debian installed it, and it can't install it, but at the same time I get a message that it can't be found?
What to do?
 
Last edited:
I tried installing it with
Code:
pip install glances[all]

If I do the
Code:
apt install glances
then I get a message that the file doesn't exist:
Code:
glances.service: Failed at step EXEC spawning /usr/local/bin/glances: No such file or directory

I can see the files in usr/bin/glances, so it's a bit weird.
 
Last edited:
That's because you have an old service unit for the one you compiled yourself (Debian never puts anything in /usr/local, that's strictly for the admin). I would uninstall both versions and reinstall the Debain one.

This is why you never install things manually if it can be helped.

ETA: Never having used glances I can't help with finding all of the things that got installed by "pip".
 
  • Like
Reactions: UdoB and Johannes S
Hi @BobhWasatch
Thankyou very much for your help.
Ahh, got it, it was so many years ago, so I had forgotten that I had made the service unit myself, so I uninstalled glances, purged it, did autoremove, removed the service unit, and then installed it again.
It starts now in servermode and localip, but if I ask it to start in webmode then I get these errors:
Aug 15 22:35:03 pve glances[430635]: ~~~~~~~~~~~~^^
Aug 15 22:35:03 pve glances[430635]: File "/usr/lib/python3/dist-packages/glances/outputs/glances_restful_api.py", line 285, in _router
Aug 15 22:35:03 pve glances[430635]: self._app.mount(self.url_prefix + '/static', StaticFiles(directory=self.STATIC_PATH), name="static")
Aug 15 22:35:03 pve glances[430635]: ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 15 22:35:03 pve glances[430635]: File "/usr/lib/python3/dist-packages/starlette/staticfiles.py", line 56, in __init__
Aug 15 22:35:03 pve glances[430635]: raise RuntimeError(f"Directory '{directory}' does not exist")
Aug 15 22:35:03 pve glances[430635]: RuntimeError: Directory '/usr/lib/python3/dist-packages/glances/outputs/static/public' does not exist
Aug 15 22:35:05 pve systemd[1]: glances.service: Main process exited, code=exited, status=1/FAILURE
Aug 15 22:35:05 pve systemd[1]: glances.service: Failed with result 'exit-code'.
Aug 15 22:35:05 pve systemd[1]: glances.service: Consumed 439ms CPU time, 67.9M memory peak.

I know you didn't know glances, so I will investigate this further, now at least I can start it, now I just have to find out why the webinterface doesn't work.
 
Ahh, the package in debian is broken for the web version :-(
That is why I was directed to the pip3 install...
 
Ok, so removing everything again.
Then
pip3 install --upgrade glances[web]
pip3 install netifaces

Then I can make my service unit for that version
:)