nicolargo / glances

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
http://nicolargo.github.io/glances/
Other
26.33k stars 1.49k forks source link

"python setup.py egg_info" failed with error code 1 #1764

Open KarelWintersky opened 3 years ago

KarelWintersky commented 3 years ago

Description

curl -L https://bit.ly/glances | /bin/bash

... 
Подготовка к распаковке …/20-python-docker_2.5.1-1_all.deb …
Распаковывается python-docker (2.5.1-1) …
Выбор ранее не выбранного пакета python-openssl.
Подготовка к распаковке …/21-python-openssl_17.5.0-1ubuntu1_all.deb …
Распаковывается python-openssl (17.5.0-1ubuntu1) …
Настраивается пакет python-idna (2.6-1) …
Настраивается пакет python-urllib3 (1.22-1ubuntu0.18.04.2) …
Настраивается пакет python-asn1crypto (0.24.0-1) …
Настраивается пакет python-certifi (2018.1.18-2) …
Настраивается пакет python-pkg-resources (39.0.1-2) …
Настраивается пакет python-backports.ssl-match-hostname (3.5.0.1-1) …
Настраивается пакет python-websocket (0.44.0-0ubuntu2) …
update-alternatives: используется /usr/bin/python2-wsdump для предоставления /usr/bin/wsdump (wsdump) в автоматическом режиме
Настраивается пакет python-cffi-backend (1.11.5-1) …
Настраивается пакет golang-docker-credential-helpers (0.5.0-2) …
Настраивается пакет python-enum34 (1.1.6-2) …
Настраивается пакет libexpat1-dev:amd64 (2.2.5-3ubuntu0.2) …
Настраивается пакет libpython2.7-dev:amd64 (2.7.17-1~18.04ubuntu1.2) …
Настраивается пакет python-ipaddress (1.0.17-1) …
Настраивается пакет python2.7-dev (2.7.17-1~18.04ubuntu1.2) …
Настраивается пакет libpython-dev:amd64 (2.7.15~rc1-1) …
Настраивается пакет python-chardet (3.0.4-1) …
Настраивается пакет python-dockerpycreds (0.2.1-1) …
Настраивается пакет python-dev (2.7.15~rc1-1) …
Настраивается пакет python-cryptography (2.1.4-1ubuntu1.4) …
Настраивается пакет python-requests (2.18.4-2ubuntu0.1) …
Настраивается пакет python-openssl (17.5.0-1ubuntu1) …
Настраивается пакет python-docker (2.5.1-1) …
Обрабатываются триггеры для man-db (2.8.3-2ubuntu0.1) …
Обрабатываются триггеры для doc-base (0.10.8) …
Обработка 1 добавленный файл doc-base...
Регистрация документа в scrollkeeper...
Install dependencies
sudo pip install setuptools glances[action,batinfo,browser,cpuinfo,docker,export,folders,gpu,graph,ip,raid,snmp,web,wifi]
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/e1/b7/182161210a13158cd3ccc41ee19aadef54496b74f2817cc147006ec932b4/setuptools-44.1.1-py2.py3-none-any.whl (583kB)
    100% |████████████████████████████████| 583kB 661kB/s
Collecting glances[action,batinfo,browser,cpuinfo,docker,export,folders,gpu,graph,ip,raid,snmp,web,wifi]
  Downloading https://files.pythonhosted.org/packages/e1/e4/86b6c447c88fc744c7a70dc69bf23baac7cffa7b39a84e887e507a896241/Glances-3.1.5.tar.gz (6.8MB)
    100% |████████████████████████████████| 6.8MB 274kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named setuptools

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-lpJ5sy/glances/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For an enhancement or new feature: Describe your needs.

Versions

Logs

nothing

nicolargo commented 3 years ago

Try to run:

apt-get install -y python-setuptools

and start again

KarelWintersky commented 3 years ago

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)
KarelWintersky commented 3 years ago
$ 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
Hierosme commented 3 years ago

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.

KarelWintersky commented 3 years ago

@Hierosme , I use:

curl -L https://bit.ly/glances | /bin/bash

and don't wont manually fixing code after curling sources, sorry.

Hierosme commented 3 years ago

normaly you just have to install python3, nothing about monify anything.

KarelWintersky commented 3 years ago

By default, installed both versions.

KarelWintersky commented 3 years ago
/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

Hierosme commented 3 years ago

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
KarelWintersky commented 3 years ago
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.

Hierosme commented 3 years ago

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

KarelWintersky commented 3 years ago
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

Hierosme commented 3 years ago

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

KarelWintersky commented 3 years ago

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
RazCrimson commented 1 year ago

@KarelWintersky

If you are still interested, can you just mention your operating system? It would make it easier to help you.