Ошибка при использовании matplotlib: «attributeError: модуль 'gi' не имеет атрибута" require_version ""Python

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Ошибка при использовании matplotlib: «attributeError: модуль 'gi' не имеет атрибута" require_version ""

Сообщение Anonymous »

Я на федоре 41, с виртуальным набором с Python 3.12.7 (matplotlib == 3.9.2). Следующий код: < /p>

Код: Выделить всё

import matplotlib.pyplot as plt
plt.figure(figsize=(10, 7))
< /code>
или только < /p>
import gi
gi.require_version("Gtk", "4.0")
< /code>
Создание ошибки "attributeError: module 'Gi' не имеет атрибута 'retact_version'".$ pip install PyGObject
...
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [48 lines of output]

...
Compiler for C supports arguments -fvisibility=hidden: YES
Found pkg-config: YES (/usr/bin/pkg-config) 2.3.0
Run-time dependency cairo found: YES 1.18.0
Run-time dependency python found: NO (tried pkgconfig, pkgconfig and sysconfig)

../cairo/meson.build:51:15: ERROR: Python dependency not found
Такая же ошибка с PIP установить Cairo
Я пробовал много решений, данных некоторыми похожими сообщениями:

Код: Выделить всё

$ pkg-config --modversion gtk4
4.16.5
< /code>
$ pip uninstall gi
WARNING: Skipping gi as it is not installed.
< /code>
$ pip install PyGTK
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [4 lines of output]
********************************************************************
* Building PyGTK using distutils is only supported on windows. *
* To build PyGTK in a supported way, read the INSTALL file.    *
********************************************************************
[end of output]
< /code>
$ sudo dnf install python3-gi
Updating and loading repositories:
Repositories loaded.
Failed to resolve the transaction:
No match for argument: python3-gi
< /code>
$ sudo dnf install python3-gobject
Updating and loading repositories:
Repositories loaded.
The package 'python3-gobject-3.48.2-3.fc41.x86_64' is already installed.
< /code>
same for python3-gobject-base
и gobject-Introspection .


Подробнее здесь: https://stackoverflow.com/questions/791 ... ribute-req
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»