logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

#1 30-08-2021 16:20:45

Debian Alain
Membre
Lieu : Bretagne
Distrib. : sid (unstable) / bullseye (stable)
Noyau : Linux sid 6.4.0-3-amd64
(G)UI : Gnome X.org (X11) / GDM3
Inscription : 11-03-2017
Site Web

[Résolu] cpu-g

bonjour à tous  big_smile  big_smile  big_smile

trouvé cette page sur le net :

https://unix.stackexchange.com/question … -debian-10

(installation de  cpu-g)

maleureusement , ce programme est conçu pour debian 10 .

les prérequis donnent ceci :

sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0


... / ...
Récupération des rapports de bogue… Fait
Analyse des informations Trouvé/Corrigé… Fait
bogues de gravité serious sur libpython3.9-dev (→ 3.9.2-1) <Résolus dans une version donnée>
 b1 - #984580 - libpython3.9-dev: missing dependency on zlib1g-dev (Corrigé : python3.9/3.9.3-1)
Résumé :
 libpython3.9-dev(1 bogue)
Êtes-vous certain(e) de vouloir installer/mettre à niveau les paquets ci-dessus ? [Y/n/?/...] n
****************************************************************
****** Sortie sur erreur pour interrompre l'installation. ******
****************************************************************
E: Le sous-processus /usr/bin/apt-listbugs apt a renvoyé un code d'erreur (10)
E: Failure running script /usr/bin/apt-listbugs apt



apt-listbugs list libpython3.9-dev


Récupération des rapports de bogue… Fait
Analyse des informations Trouvé/Corrigé… Fait
bogues de gravité serious sur libpython3.9-dev (→ ) <Résolus dans une version donnée>
 b1 - #984580 - libpython3.9-dev: missing dependency on zlib1g-dev (Corrigé : python3.9/3.9.3-1)
Résumé :
 libpython3.9-dev(1 bogue)



j'aurai aimé l'utiliser sur sid , mais , apparemment , pas possible .

apt-cache madison libpython3.9-dev


libpython3.9-dev |    3.9.6-1 | https://deb.debian.org/debian experimental/main amd64 Packages
libpython3.9-dev |    3.9.2-1 | https://deb.debian.org/debian testing/main amd64 Packages
libpython3.9-dev |    3.9.2-1 | https://deb.debian.org/debian unstable/main amd64 Packages
libpython3.9-dev |    3.9.2-1 | http://deb.debian.org/debian stable/main amd64 Packages
 python3.9 |    3.9.2-1 | https://deb.debian.org/debian unstable/main Sources



la ligne de commande demande la version 3.9.3-1 (dispo 3.9.2-1 ou 3.9.6-1 (expérimental))

donc j'attends ou je passe  mon python en expérimental ?

sudo apt -s -t experimental install libpython3.9-dev


Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances... Fait
Lecture des informations d'état... Fait      
Les paquets supplémentaires suivants seront installés :
  libpython3.9 libpython3.9-minimal libpython3.9-stdlib python3.9
  python3.9-minimal
Paquets suggérés :
  python3.9-venv python3.9-doc
Les NOUVEAUX paquets suivants seront installés :
  libpython3.9-dev
Les paquets suivants seront mis à jour :
  libpython3.9 libpython3.9-minimal libpython3.9-stdlib python3.9
  python3.9-minimal
5 mis à jour, 1 nouvellement installés, 0 à enlever et 466 non mis à jour.
Inst python3.9 [3.9.2-1] (3.9.6-1 Debian:experimental [amd64]) []
Inst libpython3.9 [3.9.2-1] (3.9.6-1 Debian:experimental [amd64]) []
Inst libpython3.9-stdlib [3.9.2-1] (3.9.6-1 Debian:experimental [amd64]) []
Inst python3.9-minimal [3.9.2-1] (3.9.6-1 Debian:experimental [amd64]) []
Inst libpython3.9-minimal [3.9.2-1] (3.9.6-1 Debian:experimental [amd64])
Inst libpython3.9-dev (3.9.6-1 Debian:experimental [amd64])
Conf python3.9 (3.9.6-1 Debian:experimental [amd64])
Conf libpython3.9 (3.9.6-1 Debian:experimental [amd64])
Conf libpython3.9-stdlib (3.9.6-1 Debian:experimental [amd64])
Conf python3.9-minimal (3.9.6-1 Debian:experimental [amd64])
Conf libpython3.9-minimal (3.9.6-1 Debian:experimental [amd64])
Conf libpython3.9-dev (3.9.6-1 Debian:experimental [amd64])
N: « apt-listbugs.back » dans le répertoire « /etc/apt/preferences.d/ » a été ignoré car il utilise une extension non valable



cat apt-listbugs.back


Explanation: Pinned by apt-listbugs at 2021-08-27 16:11:32 +0200
Explanation:   #984580: libpython3.9-dev: missing dependency on zlib1g-dev
Package: libpython3.9-dev
Pin: version 3.9.2-1
Pin-Priority: -30000



je réactive apt-listbugs .

donc , la question est :

j'attends la m.a.j. de libpython3.9-dev ou j'installe la version expérimental ?

c'est pas pressé .

amicalement ,

alain .

coyotus.png

Dernière modification par Debian Alain (03-09-2021 07:24:19)

Hors ligne

#2 30-08-2021 17:29:47

Mugen
Membre
Distrib. : Debian Bookworm
Noyau : Linux 6.1.0-9-amd64
(G)UI : Mate
Inscription : 04-02-2014

Re : [Résolu] cpu-g

Bonjour
Je ne sais pas répondre à ta question, c'était juste pour dire qu'il existe aussi cpu-x, avec paquet debian disponible pour bullseye ou bien en appimage : https://x0rg.github.io/CPU-X/
Je ne sais pas s'il y a beaucoup de différences avec cpu-g

mon ancien pseudo : bartaba

Hors ligne

#3 30-08-2021 17:43:05

vv222
Administrateur
Lieu : Bretagne
Distrib. : Debian Sid
(G)UI : sway
Inscription : 18-11-2013
Site Web

Re : [Résolu] cpu-g

Si tu lis le retour de apt-listbugs, tu verras que tu peux installer libpython3.9-dev sans aucun souci.

Jouer sous Debian ? Facile !

Ceterum censeo Barum esse delendam

En ligne

#4 30-08-2021 18:17:52

Debian Alain
Membre
Lieu : Bretagne
Distrib. : sid (unstable) / bullseye (stable)
Noyau : Linux sid 6.4.0-3-amd64
(G)UI : Gnome X.org (X11) / GDM3
Inscription : 11-03-2017
Site Web

Re : [Résolu] cpu-g

merci vv222 , dépendances installées  (prérequis) , mais :

python3 cpu-g


[Errno 2] No translation file found for domain: 'cpu-g'
Traceback (most recent call last):
  File "/home/alain/Téléchargements/cpu-g/bin/cpu-g", line 41, in <module>
    from cpug import CPUG
  File "/home/alain/Téléchargements/cpu-g/src/cpug.py", line 40, in <module>
    from matplotlib.figure import Figure
ModuleNotFoundError: No module named 'matplotlib'



même ce site n'a pas pu m'aider :

https://askubuntu.com/questions/1161704 … n-on-18-04

je commence à croire que cpu-g est prévu pour ubuntu .

je te remercie bartaba , je vais me contenter de  cpu-x  .

merci à tous .

si vous trouvez une soluce , dites le moi .

je laisse trainer ce fil ...

amicalement ,

alain.

coyotus.png

Hors ligne

#5 31-08-2021 08:45:23

vv222
Administrateur
Lieu : Bretagne
Distrib. : Debian Sid
(G)UI : sway
Inscription : 18-11-2013
Site Web

Re : [Résolu] cpu-g

Debian Alain a écrit :

ModuleNotFoundError: No module named 'matplotlib'


L’erreur est explicite, le module Python requis python3-matplotlib est manquant.


Jouer sous Debian ? Facile !

Ceterum censeo Barum esse delendam

En ligne

#6 02-09-2021 09:30:13

Debian Alain
Membre
Lieu : Bretagne
Distrib. : sid (unstable) / bullseye (stable)
Noyau : Linux sid 6.4.0-3-amd64
(G)UI : Gnome X.org (X11) / GDM3
Inscription : 11-03-2017
Site Web

Re : [Résolu] cpu-g

merci vv222  big_smile  big_smile  big_smile

matplotlib installé dans python 3 .

mais :

python3 cpu-g


[Errno 2] No translation file found for domain: 'cpu-g'
Traceback (most recent call last):
  File "/home/alain/Téléchargements/cpu-g/bin/cpu-g", line 42, in <module>
    cpug = CPUG()
  File "/home/alain/Téléchargements/cpu-g/src/cpug.py", line 999, in __init__
    self.update_info()
  File "/home/alain/Téléchargements/cpu-g/src/cpug.py", line 1177, in update_info
    self.distribution.set_text(inv.distro())
  File "/home/alain/Téléchargements/cpu-g/src/investigator.py", line 307, in distro
    return get_distro()
  File "/home/alain/Téléchargements/cpu-g/src/distro.py", line 39, in get_distro
    version_split = RELEASE_DATA["VERSION"].split(" ", maxsplit=1)
KeyError: 'VERSION'



cat cpu-g


#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# CPU-G is a program that displays information about your CPU,
# RAM, Motherboard and some general information about your System.
#
# Copyright © 2009  Fotis Tsamis <ftsamis at gmail dot com>.
# Copyright © 2016-2019  Lorenzo Carbonell (aka atareao)
# <lorenzo.carbonell.cerezo at gmail dotcom>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import sys
import gi
try:
    gi.require_version('Gtk', '3.0')
except Exception as e:
    print(e)
    exit(-1)
from gi.repository import Gtk

if __name__ == '__main__':
    if __file__.startswith('/opt/extras.ubuntu.com/cpu-g') or\
            os.getcwd().startswith('/opt/extras.ubuntu.com/cpu-g'):
        sys.path.insert(1, '/opt/extras.ubuntu.com/cpu-g/share/cpu-g')
    else:
        sys.path.insert(1,
                        os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../src')))
    from cpug import CPUG
    cpug = CPUG()
    Gtk.main()
exit(0)

Hors ligne

#7 02-09-2021 10:52:15

vv222
Administrateur
Lieu : Bretagne
Distrib. : Debian Sid
(G)UI : sway
Inscription : 18-11-2013
Site Web

Re : [Résolu] cpu-g

Debian Alain a écrit :


  File "/home/alain/Téléchargements/cpu-g/src/distro.py", line 39, in get_distro
    version_split = RELEASE_DATA["VERSION"].split(" ", maxsplit=1)
KeyError: 'VERSION'


Ça ressemble à un bug de cpu-g.
Il faudrait voir la définition complète de la fonction get_distro dans le fichier /home/alain/Téléchargements/cpu-g/src/distro.py, la manière dont elle récupère l’information RELEASE_DATA n’est apparemment pas assez robuste.


Jouer sous Debian ? Facile !

Ceterum censeo Barum esse delendam

En ligne

#8 02-09-2021 11:08:27

Debian Alain
Membre
Lieu : Bretagne
Distrib. : sid (unstable) / bullseye (stable)
Noyau : Linux sid 6.4.0-3-amd64
(G)UI : Gnome X.org (X11) / GDM3
Inscription : 11-03-2017
Site Web

Re : [Résolu] cpu-g

merci vv222 .

j'ai trouvé le fichier dont tu parles .
je n'y connais rien .
je te le soumets :

cat /home/alain/Téléchargements/cpu-g/src/distro.py


#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# CPU-G is a program that displays information about your CPU,
# RAM, Motherboard and some general information about your System.
#
# Copyright © 2009  Fotis Tsamis <ftsamis at gmail dot com>.
# Copyright © 2016-2019  Lorenzo Carbonell (aka atareao)
# <lorenzo.carbonell.cerezo at gmail dot com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import csv

RELEASE_DATA = {}

def get_distro():
    with open("/etc/os-release") as f:
        reader = csv.reader(f, delimiter="=")
        for row in reader:
            if row:
                RELEASE_DATA[row[0]] = row[1]

    if RELEASE_DATA["ID"] in ["debian", "raspbian"]:
        with open("/etc/debian_version") as f:
            DEBIAN_VERSION = f.readline().strip()
        major_version = DEBIAN_VERSION.split(".")[0]
        version_split = RELEASE_DATA["VERSION"].split(" ", maxsplit=1)
        if version_split[0] == major_version:
            # Just major version shown, replace it with the full version
            RELEASE_DATA["VERSION"] = " ".join([DEBIAN_VERSION] + version_split[1:])
    return "{} {}".format(RELEASE_DATA["NAME"], RELEASE_DATA.get("VERSION", ""))


if __name__ == '__main__':
    print(get_distro())

Hors ligne

#9 02-09-2021 12:14:44

vv222
Administrateur
Lieu : Bretagne
Distrib. : Debian Sid
(G)UI : sway
Inscription : 18-11-2013
Site Web

Re : [Résolu] cpu-g

Le bout qui nous intéresse est celui-ci :

def get_distro():
    with open("/etc/os-release") as f:
        reader = csv.reader(f, delimiter="=")
        for row in reader:
            if row:
                RELEASE_DATA[row[0]] = row[1]

    if RELEASE_DATA["ID"] in ["debian", "raspbian"]:
        with open("/etc/debian_version") as f:
            DEBIAN_VERSION = f.readline().strip()
        major_version = DEBIAN_VERSION.split(".")[0]
        version_split = RELEASE_DATA["VERSION"].split(" ", maxsplit=1)
        if version_split[0] == major_version:
            # Just major version shown, replace it with the full version
            RELEASE_DATA["VERSION"] = " ".join([DEBIAN_VERSION] + version_split[1:])
    return "{} {}".format(RELEASE_DATA["NAME"], RELEASE_DATA.get("VERSION", ""))


Cette fonction s’attend à ce que le fichier /etc/os-release inclue un champ "VERSION", mais ce n’est pas le cas de celui que j’ai sur ma Debian Sid :

PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"



Je te propose de modifier le fichier Python distro.py, en remplaçant la définition de la fonction get_distro par celle-ci :

def get_distro():
    with open("/etc/os-release") as f:
        reader = csv.reader(f, delimiter="=")
        for row in reader:
            if row:
                RELEASE_DATA[row[0]] = row[1]

    if RELEASE_DATA["ID"] in ["debian", "raspbian"]:
        with open("/etc/debian_version") as f:
            DEBIAN_VERSION = f.readline().strip()
        major_version = DEBIAN_VERSION.split(".")[0]
        try:
            version_split = RELEASE_DATA["VERSION"].split(" ", maxsplit=1)
        except KeyError:
            # VERSION is not set for Debian Sid, fall back on a default value
            version_split = ['12', '(bookworm/sid)']
        if version_split[0] == major_version:
            # Just major version shown, replace it with the full version
            RELEASE_DATA["VERSION"] = " ".join([DEBIAN_VERSION] + version_split[1:])
    return "{} {}".format(RELEASE_DATA["NAME"], RELEASE_DATA.get("VERSION", ""))


Jouer sous Debian ? Facile !

Ceterum censeo Barum esse delendam

En ligne

#10 02-09-2021 12:27:41

Debian Alain
Membre
Lieu : Bretagne
Distrib. : sid (unstable) / bullseye (stable)
Noyau : Linux sid 6.4.0-3-amd64
(G)UI : Gnome X.org (X11) / GDM3
Inscription : 11-03-2017
Site Web

Re : [Résolu] cpu-g

voilà ce que j'ai fait  :

#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# CPU-G is a program that displays information about your CPU,
# RAM, Motherboard and some general information about your System.
#
# Copyright © 2009  Fotis Tsamis <ftsamis at gmail dot com>.
# Copyright © 2016-2019  Lorenzo Carbonell (aka atareao)
# <lorenzo.carbonell.cerezo at gmail dot com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import csv

RELEASE_DATA = {}

#def get_distro():
#    with open("/etc/os-release") as f:
#        reader = csv.reader(f, delimiter="=")
#        for row in reader:
#            if row:
#                RELEASE_DATA[row[0]] = row[1]
#
#    if RELEASE_DATA["ID"] in ["debian", "raspbian"]:
#        with open("/etc/debian_version") as f:
#            DEBIAN_VERSION = f.readline().strip()
#        major_version = DEBIAN_VERSION.split(".")[0]
#        version_split = RELEASE_DATA["VERSION"].split(" ", maxsplit=1)
#        if version_split[0] == major_version:
#            # Just major version shown, replace it with the full version
#            RELEASE_DATA["VERSION"] = " ".join([DEBIAN_VERSION] + version_split[1:])
#    return "{} {}".format(RELEASE_DATA["NAME"], RELEASE_DATA.get("VERSION", ""))

def get_distro():
    with open("/etc/os-release") as f:
        reader = csv.reader(f, delimiter="=")
        for row in reader:
            if row:
                RELEASE_DATA[row[0]] = row[1]

    if RELEASE_DATA["ID"] in ["debian", "raspbian"]:
        with open("/etc/debian_version") as f:
            DEBIAN_VERSION = f.readline().strip()
        major_version = DEBIAN_VERSION.split(".")[0]
        try:
            version_split = RELEASE_DATA["VERSION"].split(" ", maxsplit=1)
        except KeyError:
            # VERSION is not set for Debian Sid, fall back on a default value
            version_split = ['12', '(bookworm/sid)']
        if version_split[0] == major_version:
            # Just major version shown, replace it with the full version
            RELEASE_DATA["VERSION"] = " ".join([DEBIAN_VERSION] + version_split[1:])
    return "{} {}".format(RELEASE_DATA["NAME"], RELEASE_DATA.get("VERSION", ""))


if __name__ == '__main__':
    print(get_distro())

 



j'ai bon ?

Dernière modification par Debian Alain (02-09-2021 13:00:43)

Hors ligne

#11 02-09-2021 12:38:08

vv222
Administrateur
Lieu : Bretagne
Distrib. : Debian Sid
(G)UI : sway
Inscription : 18-11-2013
Site Web

Re : [Résolu] cpu-g

Ça m’a l’air bien, je te laisse tester que ça évite l’erreur précédente.

Si tu veux leur envoyer un rapport de bug, c’est un souci qui se posera systématiquement sur Debian Sid parce que son fichier /etc/os-release ne contient pas tous les champs qu’on trouve dans ce même fichier sur une Debian stable. Avec une copie de ton fichier /etc/os-release pour illustrer, les devs de cpu-g devraient pouvoir écrire un correctif facilement.

Jouer sous Debian ? Facile !

Ceterum censeo Barum esse delendam

En ligne

#12 02-09-2021 13:37:20

Debian Alain
Membre
Lieu : Bretagne
Distrib. : sid (unstable) / bullseye (stable)
Noyau : Linux sid 6.4.0-3-amd64
(G)UI : Gnome X.org (X11) / GDM3
Inscription : 11-03-2017
Site Web

Re : [Résolu] cpu-g

doléances transmises aux developpeurs github .

https://github.com/atareao/cpu-g/issues

https://github.com/atareao/cpu-g

reste un souci , mineur  je pense .
le "desktop environment" et le "window manager" ne sont pas reconnus .
mais c'est pas  trop grave .
un peu gênant tout au plus :

1ym4cGAm.png

Dernière modification par Debian Alain (02-09-2021 20:26:37)

Hors ligne

Pied de page des forums