Python예외

Python예외

lightdm-gtk-greeter-settings를 실행하거나 Python 애플리케이션을 컴파일할 때 이러한 오류가 발생합니다.

Python과 관련이 있는 것으로 보이지만 이를 해결하려면 어떤 단계를 수행해야 하는지 잘 모르겠습니다. Python 기본 3.5 설치(2.7도 설치됨)

운영 체제 Manjaro XFCE(Arch 64 기반)

누군가 문제가 무엇인지 말해 줄 수 있습니까?

감사해요

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/enum34-1.0.4-py3.5.egg/enum/__init__.py", line 371, in __getattr__
KeyError: '_convert'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/lightdm-gtk-greeter-settings", line 33, in <module>
    lightdm_gtk_greeter_settings.main()
  File "/usr/lib/python3.5/site-packages/lightdm_gtk_greeter_settings/__init__.py", line 24, in main
    from gi.repository import Gtk
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/usr/lib/python3.5/site-packages/gi/importer.py", line 115, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/usr/lib/python3.5/site-packages/gi/overrides/__init__.py", line 125, in load_overrides
    override_mod = importlib.import_module(override_package_name)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/lib/python3.5/site-packages/gi/overrides/Gtk.py", line 26, in <module>
    from gi.repository import GObject
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/usr/lib/python3.5/site-packages/gi/importer.py", line 115, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/usr/lib/python3.5/site-packages/gi/overrides/__init__.py", line 125, in load_overrides
    override_mod = importlib.import_module(override_package_name)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/lib/python3.5/site-packages/gi/overrides/GObject.py", line 31, in <module>
    from gi.repository import GLib
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/usr/lib/python3.5/site-packages/gi/importer.py", line 115, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/usr/lib/python3.5/site-packages/gi/overrides/__init__.py", line 125, in load_overrides
    override_mod = importlib.import_module(override_package_name)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/lib/python3.5/site-packages/gi/overrides/GLib.py", line 22, in <module>
    import signal
  File "/usr/lib/python3.5/signal.py", line 8, in <module>
    _IntEnum._convert(
  File "/usr/lib/python3.5/site-packages/enum34-1.0.4-py3.5.egg/enum/__init__.py", line 373, in __getattr__
AttributeError: _convert

답변1

이 코드는 Python 3.5에서 실행 중입니다. 하지만 enum은 3.4 이하 버전에서만 실행되는 것 같습니다. /usr/bin/python2.7인터프리터를 실행해 보세요 . 또는 초기 Python 3<= 3.4

답변2

이 문제는 이제 Freenode의 #python에 대한 The-Compiler의 훌륭한 도움으로 해결되었습니다.

cd /usr/lib/python3.5/site-packages; pacman -Qo * 2>&1 | grep '^error:'

site-packages 디렉터리에 나열된 모든 패키지를 제거합니다.

관련 정보