Open KarelWintersky opened 3 years ago
Try to run:
apt-get install -y python-setuptools
and start again
Installed successfully, but...
arris@whitegoldtower:~$ glances
Traceback (most recent call last):
File "/usr/local/bin/glances", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/glances/__init__.py", line 143, in main
start(config=config, args=args)
File "/usr/local/lib/python2.7/dist-packages/glances/__init__.py", line 108, in start
mode = GlancesMode(config=config, args=args)
File "/usr/local/lib/python2.7/dist-packages/glances/standalone.py", line 78, in __init__
self.stats.update()
File "/usr/local/lib/python2.7/dist-packages/glances/stats.py", line 234, in update
self._plugins[p].update()
File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_plugin.py", line 925, in wrapper
ret = fct(self, *args, **kw)
File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_plugin.py", line 935, in wrapper
ret = fct(*args, **kw)
File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_connections.py", line 116, in update
logger.debug('Can not get network connections track ({})'.format(e))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 10: ordinal not in range(128)
$ ls -la /proc/sys/net/netfilter
итого 0
dr-xr-xr-x 1 root root 0 дек 23 14:34 .
dr-xr-xr-x 1 root root 0 дек 23 12:13 ..
dr-xr-xr-x 1 root root 0 дек 23 14:34 nf_log
-rw-r--r-- 1 root root 0 дек 23 14:34 nf_log_all_netns
Clearly look a trouble about Python2 and Unicode.
In case you can Use Python3, you certainlly fixe the trouble easilly. Python2 is deprecated from a moment from now, and you look to have a Special CharSet it haven't been tested. Actually you system look to use UTF-8 , you certainlly have to install Python3 for have a native UTF-8 support.
If you want try to fixe it you have to try a str($STRING).code().decode() on the line 114 of plugins/glances_connections.py
with open(self.conntrack[i], 'r') as f:
stats[i] = float(f.readline().rstrip("\n"))
Actually you system return a UTF-8 symbol , and the poor ascii can't read it, and unfortunally it have no true way for determine a coding char for the port str(). The workarround consit generally to chain code and decode.
@Hierosme , I use:
curl -L https://bit.ly/glances | /bin/bash
and don't wont manually fixing code after curling sources, sorry.
normaly you just have to install python3, nothing about monify anything.
By default, installed both versions.
/usr/local/bin$ python3 glances
Traceback (most recent call last):
File "glances", line 7, in <module>
from glances import main
ModuleNotFoundError: No module named 'glances'
I don't understand nothing. Software does not work
yes Glances is a software you can't call it with python3 glances
.
you wan see wish python version is you default one with
whish python
or
python --version
You trouble is UTF-8 Charset due to you system setting, i just suggess to try with Python3.
from: https://stackoverflow.com/questions/5846167/how-to-change-default-python-version
$ which python3
/usr/local/bin/python3
Write alias in bash_profile
vi ~/.bash_profile
alias python='/usr/local/bin/python3'
Reload bash_profile
source ~/.bash_profile
Confirm python command
$ python --version
Python 3.6.5
arris@whitegoldtower:~$ python --version
Python 3.6.9
arris@whitegoldtower:~$ glances
Traceback (most recent call last):
File "/usr/local/bin/glances", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/glances/__init__.py", line 145, in main
start(config=config, args=args)
File "/usr/local/lib/python2.7/dist-packages/glances/__init__.py", line 110, in start
mode = GlancesMode(config=config, args=args)
File "/usr/local/lib/python2.7/dist-packages/glances/standalone.py", line 78, in __init__
self.stats.update()
File "/usr/local/lib/python2.7/dist-packages/glances/stats.py", line 234, in update
self._plugins[p].update()
File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_plugin.py", line 993, in wrapper
ret = fct(self, *args, **kw)
File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_plugin.py", line 1003, in wrapper
ret = fct(*args, **kw)
File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_connections.py", line 116, in update
logger.debug('Can not get network connections track ({})'.format(e))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 10: ordinal not in range(128)
Nothing changed.
I'm really confuse,
The message you copy indicate that using Python 2.7 /usr/local/lib/python2.7/dist-packages/glances indicate you ahve only install glance for python2 and python2 do not support you charset.
May be a pip3 install psutils glances
after have clean you previus python2 installation
after have clean you previus python2 installation
can't uninstall python2 :
arris@whitegoldtower:~$ sudo apt remove python2
...
E: Unable find package python2
arris@whitegoldtower:~$ sudo apt remove python
Next packages will DELETED:
apturl apturl-common boot-repair boot-sav boot-sav-extra cherrytree cinnamon cinnamon-dbg cinnamon-screensaver dia dia-common dia-shapes gdebi gdebi-core gir1.2-xapp-1.0 glade2script mint-common
mint-meta-cinnamon mint-meta-core mintbackup mintdesktop mintdrivers mintinstall mintlocale mintmenu mintreport mintsources mintstick mintsystem mintupdate mintwelcome nemo nemo-data nemo-dbg
nemo-fileroller nemo-preview nemo-share ntfs-config nvidia-prime-applet python python-all python-all-dev python-apt python-asn1crypto python-attr python-automat python-backports.ssl-match-hostname
python-cairo python-certifi python-cffi-backend python-chardet python-click python-colorama python-configobj python-constantly python-crypto python-cryptography python-dateutil python-dbus
python-dev python-docker python-dockerpycreds python-enchant python-enum34 python-gi python-gi-cairo python-glade2 python-gobject-2 python-gtk2 python-gtksourceview2 python-hyperlink python-idna
python-incremental python-ipaddress python-keyring python-keyrings.alt python-ldb python-lockfile python-notify python-openssl python-pam python-pip python-pkg-resources python-pyasn1
python-pyasn1-modules python-pyparsing python-requests python-samba python-secretstorage python-serial python-service-identity python-setproctitle python-setuptools python-six python-squaremap
python-tdb python-twisted-bin python-twisted-core python-urllib3 python-websocket python-wheel python-wxgtk3.0 python-wxversion python-xdg python-xlib python-zope.interface samba-common-bin
software-properties-common speedtest-cli taskcoach ubuntu-system-adjustments xed xed-common xed-dbg
ВНИМАНИЕ: Следующие пакеты первой необходимости будут удалены.
НЕ ДЕЛАЙТЕ этого, если вы НЕ представляете себе все возможные последствия!
mintsources mint-common (вследствие mintsources) gir1.2-xapp-1.0 (вследствие mintsources)
i.e. my OS will broke
Yes you OS will Die, don't uninstall Python2.
You trouble is commun install trouble python2 vs python3
For install a python3 package use pip3 command , where generally pip point to python2
sudo apt-get remove glances
sudo pip uninstall psutils glances
pip uninstall psutils glances
sudo pip3 install psutils glances
hope it will fixe you trouble
Regards
My OS is cursed :(
root@whitegoldtower:~# sudo pip3 install psutils glances
sudo: pip3: command not found
root@whitegoldtower:~# apt install pip3
....
E: Can't find package pip3
@KarelWintersky
If you are still interested, can you just mention your operating system? It would make it easier to help you.
Description
curl -L https://bit.ly/glances | /bin/bash
For an enhancement or new feature: Describe your needs.
Versions
Logs
nothing