Ubuntu 9.04, python 2.5: import pygtk - ImportError: No module named pygtk

Antworten
Nachricht
Autor
der alte

Ubuntu 9.04, python 2.5: import pygtk - ImportError: No module named pygtk

#1 Beitrag von der alte » 18. Sep 2009 21:40

import pygtk - ImportError: No module named pygtk

Guten Abend,

ich bin hier am verzweifeln: Ich habe von python keinen Ahnung, ich will nur ein Programm starten.

Dann kommt immer diese Meldung:

Code: Alles auswählen

Traceback (most recent call last):
  File "/usr/share/convirt/src/convirt.py", line 57, in <module>
    from TreeViewTooltips import TreeViewTooltips
  File "/usr/share/convirt/src/TreeViewTooltips.py", line 97, in <module>
    import pygtk
ImportError&#58; No module named pygtk
Ich habe mich schon durch das Netz gewühlt, aber nix brauchbares hervorgeholt....

Ein paar Infos:# echo $PYTHONPATH
/usr/lib/python2.5:/usr/lib/python2.5/site-packages/gtk-2.0

Weiß zwar nicht wofür, aber es wurde mal danach gefragt:

Code: Alles auswählen

# python -v -c 'import pygtk'=20
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.5/site.pyc matches /usr/lib/python2.5/site.py
import site # precompiled from /usr/lib/python2.5/site.pyc
# /usr/lib/python2.5/os.pyc matches /usr/lib/python2.5/os.py
import os # precompiled from /usr/lib/python2.5/os.pyc
import errno # builtin
import posix # builtin
# /usr/lib/python2.5/posixpath.pyc matches /usr/lib/python2.5/posixpath.py
import posixpath # precompiled from /usr/lib/python2.5/posixpath.pyc
# /usr/lib/python2.5/stat.pyc matches /usr/lib/python2.5/stat.py
import stat # precompiled from /usr/lib/python2.5/stat.pyc
# /usr/lib/python2.5/UserDict.pyc matches /usr/lib/python2.5/UserDict.py
import UserDict # precompiled from /usr/lib/python2.5/UserDict.pyc
# /usr/lib/python2.5/copy_reg.pyc matches /usr/lib/python2.5/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.5/copy_reg.pyc
# /usr/lib/python2.5/types.pyc matches /usr/lib/python2.5/types.py
import types # precompiled from /usr/lib/python2.5/types.pyc
# /usr/lib/python2.5/sitecustomize.pyc matches /usr/lib/python2.5/sitecustomize.py
import sitecustomize # precompiled from /usr/lib/python2.5/sitecustomize.pyc
import encodings # directory /usr/lib/python2.5/encodings
# /usr/lib/python2.5/encodings/__init__.pyc matches /usr/lib/python2.5/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.5/encodings/__init__.pyc
# /usr/lib/python2.5/codecs.pyc matches /usr/lib/python2.5/codecs.py
import codecs # precompiled from /usr/lib/python2.5/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.5/encodings/aliases.pyc matches /usr/lib/python2.5/encodings/aliases.py
import encodings.aliases # precompiled from /usr/lib/python2.5/encodings/aliases.pyc
# /usr/lib/python2.5/encodings/utf_8.pyc matches /usr/lib/python2.5/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/lib/python2.5/encodings/utf_8.pyc
Python 2.6.2 &#40;release26-maint, Apr 19 2009, 01&#58;58&#58;18&#41; 
&#91;GCC 4.3.3&#93; on linux2
Type "help", "copyright", "credits" or "license" for more information.
  File "<string>", line 1
    import pygtk=20
                ^
SyntaxError&#58; invalid syntax
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup&#91;1&#93; site
# cleanup&#91;1&#93; encodings
# cleanup&#91;1&#93; _codecs
# cleanup&#91;1&#93; _warnings
# cleanup&#91;1&#93; zipimport
# cleanup&#91;1&#93; encodings.utf_8
# cleanup&#91;1&#93; codecs
# cleanup&#91;1&#93; types
# cleanup&#91;1&#93; sitecustomize
# cleanup&#91;1&#93; signal
# cleanup&#91;1&#93; posix
# cleanup&#91;1&#93; encodings.aliases
# cleanup&#91;1&#93; exceptions
# cleanup&#91;2&#93; copy_reg
# cleanup&#91;2&#93; posixpath
# cleanup&#91;2&#93; errno
# cleanup&#91;2&#93; os.path
# cleanup&#91;2&#93; stat
# cleanup&#91;2&#93; UserDict
# cleanup&#91;2&#93; os
# cleanup sys
# cleanup __builtin__
# cleanup ints&#58; 9 unfreed ints
# cleanup floats
root@xen&#58;/home/joern# convirt 
Traceback &#40;most recent call last&#41;&#58;
  File "/usr/share/convirt/src/convirt.py", line 57, in <module>
    from TreeViewTooltips import TreeViewTooltips
  File "/usr/share/convirt/src/TreeViewTooltips.py", line 97, in <module>
    import pygtk
ImportError&#58; No module named pygtk

Code: Alles auswählen

# dpkg -l "*python-gtk*"|grep ^ii|tr -s " "|cut -d" " -f2-3
python-gtk2 2.14.1-1ubuntu1
python-gtk2-dev 2.14.1-1ubuntu1
python-gtk2-doc 2.14.1-1ubuntu1
python-gtkhtml2 2.19.1-0ubuntu14
python-gtksourceview2 2.6.0-0ubuntu1
Danke für gute Ideen ;)

Grüße
der alte

der alte

Änderungsnachtrag

#2 Beitrag von der alte » 18. Sep 2009 21:53

So,

ich habe den PYTHONPATH logischischer weise auch um den /usr/lib64/..-Bereich erweitert.

Nun läuft python -v -c 'import pygtk'=20 fehlerfrei durch.

Aber will ich das Programm starten, wieder das alte Spiel:

Code: Alles auswählen

# convirt 
Traceback &#40;most recent call last&#41;&#58;
  File "/usr/share/convirt/src/convirt.py", line 57, in <module>
    from TreeViewTooltips import TreeViewTooltips
  File "/usr/share/convirt/src/TreeViewTooltips.py", line 97, in <module>
    import pygtk
ImportError&#58; No module named pygtk
Gruß
der alte

der alte

gelöst

#3 Beitrag von der alte » 18. Sep 2009 22:44

Es geht :)

Die Ubuntuversion war nix.
Habe mir von der Herstellerseite http://www.convirture.com/downloads/convirt/
eine aktuelle Version geholt
, bye

Antworten