| Summary: | python-module-pygobject3 'gi.repository.Gdk' object has no attribute 'Color' | ||
|---|---|---|---|
| Product: | Sisyphus | Reporter: | gBopHuk <gbophuk_alt> |
| Component: | python-module-pygobject3 | Assignee: | Yuri N. Sedunov <aris> |
| Status: | CLOSED NOTABUG | QA Contact: | qa-sisyphus |
| Severity: | normal | ||
| Priority: | P3 | CC: | aris |
| Version: | unstable | ||
| Hardware: | all | ||
| OS: | Linux | ||
Не воспроизводится:
$ python
Python 2.7.11 (default, Apr 15 2016, 13:09:43)
[GCC 5.3.1 20151207 (ALT Linux 5.3.1-alt3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> gi.require_version('Gdk', '3.0')
>>> from gi.repository import Gdk
>>>
______________________________________________________________
$ ipython
Python 2.7.11 (default, Apr 15 2016, 13:09:43)
Type "copyright", "credits" or "license" for more information.
IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import gi
In [2]: gi.require_version('Gdk', '3.0')
In [3]: from gi.repository import Gdk
In [4]:
(В ответ на комментарий №1)
> Не воспроизводится:
>
> $ python
> Python 2.7.11 (default, Apr 15 2016, 13:09:43)
> [GCC 5.3.1 20151207 (ALT Linux 5.3.1-alt3)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import gi
> >>> gi.require_version('Gdk', '3.0')
> >>> from gi.repository import Gdk
> >>>
> ______________________________________________________________
> $ ipython
> Python 2.7.11 (default, Apr 15 2016, 13:09:43)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 4.0.0 -- An enhanced Interactive Python.
> ? -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help -> Python's own help system.
> object? -> Details about 'object', use 'object??' for extra details.
>
> In [1]: import gi
>
> In [2]: gi.require_version('Gdk', '3.0')
>
> In [3]: from gi.repository import Gdk
>
> In [4]:
Интересно, может мне надо что-то ещё доустановить?
$ipython
Python 2.7.11 (default, Apr 15 2016, 13:09:43)
Type "copyright", "credits" or "license" for more information.
IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]:import gi
ERROR - failed to write data to stream: <open file '<stdout>', mode 'w' at 0x7fc2c14c0150>
(В ответ на комментарий №2) > Интересно, может мне надо что-то ещё доустановить? > $ipython > Python 2.7.11 (default, Apr 15 2016, 13:09:43) > Type "copyright", "credits" or "license" for more information. > > IPython 4.0.0 -- An enhanced Interactive Python. > ? -> Introduction and overview of IPython's features. > %quickref -> Quick reference. > help -> Python's own help system. > object? -> Details about 'object', use 'object??' for extra details. > > In [1]:import gi > ERROR - failed to write data to stream: <open file '<stdout>', mode 'w' at > 0x7fc2c14c0150> Простите, не в том окружении запускал. Вот результат из того окружения где собираю пакет. ython 2.7.11 (default, Apr 15 2016, 13:09:43) Type "copyright", "credits" or "license" for more information. IPython 4.0.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: import gi In [2]: gi.require_version('Gdk', '3.0') --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-2-4a32b79a80ff> in <module>() ----> 1 gi.require_version('Gdk', '3.0') /usr/lib64/python2.7/site-packages/gi/__init__.pyc in require_version(namespace, version) 120 if version not in available_versions: 121 raise ValueError('Namespace %s not available for version %s' % --> 122 (namespace, version)) 123 124 _versions[namespace] = version ValueError: Namespace Gdk not available for version 3.0 |
При попытке импорта Gdk получаю ошибку об отсутвии поля Color: Воспроизведение: Запускаем ipython и сразу импортируем Gdk -------------------------------------- In [1]: from gi.repository import Gdk --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-1-1729d27468b9> in <module>() ----> 1 from gi.repository import Gdk /usr/lib64/python2.7/site-packages/gi/importer.pyc in load_module(self, fullname) 144 for dep in repository.get_immediate_dependencies(namespace): 145 importlib.import_module('gi.repository.' + dep.split("-")[0]) --> 146 dynamic_module = load_overrides(introspection_module) 147 148 dynamic_module.__file__ = '<%s>' % fullname /usr/lib64/python2.7/site-packages/gi/overrides/__init__.pyc in load_overrides(introspection_module) 123 return introspection_module 124 --> 125 override_mod = importlib.import_module(override_package_name) 126 127 finally: /usr/lib64/python2.7/importlib/__init__.pyc in import_module(name, package) 35 level += 1 36 name = _resolve_name(name[level:], package, level) ---> 37 __import__(name) 38 return sys.modules[name] /usr/lib64/python2.7/site-packages/gi/overrides/Gdk.py in <module>() 41 42 ---> 43 class Color(Gdk.Color): 44 MAX_VALUE = 65535 45 /usr/lib64/python2.7/site-packages/gi/module.pyc in __getattr__(self, name) 137 if not info: 138 raise AttributeError("%r object has no attribute %r" % ( --> 139 self.__name__, name)) 140 141 if isinstance(info, EnumInfo): AttributeError: 'gi.repository.Gdk' object has no attribute 'Color' --------------------------------------------------- Пакеты в системе: $ rpm -qa | grep -i "(python-module-pygobject3)" python-module-pygobject3-common-devel-3.22.0-alt1.x86_64 python-module-pygobject3-3.22.0-alt1.x86_64 python-module-pygobject3-devel-3.22.0-alt1.noarch $ rpm -qa | egrep -i --color -- "(ipython)" python-module-ipython_genutils-0.1.0-alt1.1.1.noarch ipython-4.0.0-alt3.1.1.noarch ------------------------------- Не исключаю что я не правильно делаю импорт, но данный код не вызывал проблем ещё пару месяцев назад.