Seite 1 von 1

'import site' failed

Verfasst: Montag 17. Dezember 2007, 16:42
von StuL
Guten Tag.

Mein Deutsch ist nicht so wunderschön aber ich habe ein Problem mit Python, damit ich heir versuchen, Hilfe zu finden.

Ich versuche, das HellaHella Program zu installieren aber, wenn ich so schreibe:

Code: Alles auswählen

sudo python ez_setup.py -U hellahella==dev
bekomme ich Probleme, wie so:

Code: Alles auswählen

'import site' failed; use -v for traceback
Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c7-py2.5.egg
Traceback (most recent call last):
  File "ez_setup.py", line 229, in <module>
    main(sys.argv[1:])
  File "ez_setup.py", line 163, in main
    from setuptools.command.easy_install import main
  File "/home/stu/Desktop/setuptools-0.6c7-py2.5.egg/setuptools/__init__.py", line 2, in <module>
  File "/home/stu/Desktop/setuptools-0.6c7-py2.5.egg/setuptools/extension.py", line 2, in <module>
  File "/home/stu/Desktop/setuptools-0.6c7-py2.5.egg/setuptools/dist.py", line 5, in <module>
  File "/home/stu/Desktop/setuptools-0.6c7-py2.5.egg/setuptools/command/install.py", line 2, in <module>
  File "/usr/lib/python2.5/distutils/command/install.py", line 22, in <module>
    libname = sys.lib
AttributeError: 'module' object has no attribute 'lib'
Wenn ich python -v schreibe, bekomme ich:

Code: Alles auswählen

# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
import site # precompiled from /usr/local/lib/python2.5/site.pyc
# /usr/local/lib/python2.5/os.pyc matches /usr/local/lib/python2.5/os.py
import os # precompiled from /usr/local/lib/python2.5/os.pyc
import posix # builtin
# /usr/local/lib/python2.5/posixpath.pyc matches /usr/local/lib/python2.5/posixpath.py
import posixpath # precompiled from /usr/local/lib/python2.5/posixpath.pyc
# /usr/local/lib/python2.5/stat.pyc matches /usr/local/lib/python2.5/stat.py
import stat # precompiled from /usr/local/lib/python2.5/stat.pyc
# /usr/local/lib/python2.5/UserDict.pyc matches /usr/local/lib/python2.5/UserDict.py
import UserDict # precompiled from /usr/local/lib/python2.5/UserDict.pyc
# /usr/local/lib/python2.5/copy_reg.pyc matches /usr/local/lib/python2.5/copy_reg.py
import copy_reg # precompiled from /usr/local/lib/python2.5/copy_reg.pyc
# /usr/local/lib/python2.5/types.pyc matches /usr/local/lib/python2.5/types.py
import types # precompiled from /usr/local/lib/python2.5/types.pyc
import _types # builtin
# /usr/local/lib/python2.5/warnings.pyc matches /usr/local/lib/python2.5/warnings.py
import warnings # precompiled from /usr/local/lib/python2.5/warnings.pyc
# /usr/local/lib/python2.5/linecache.pyc matches /usr/local/lib/python2.5/linecache.py
import linecache # precompiled from /usr/local/lib/python2.5/linecache.pyc
import encodings # directory /usr/local/lib/python2.5/encodings
# /usr/local/lib/python2.5/encodings/__init__.pyc matches /usr/local/lib/python2.5/encodings/__init__.py
import encodings # precompiled from /usr/local/lib/python2.5/encodings/__init__.pyc
# /usr/local/lib/python2.5/codecs.pyc matches /usr/local/lib/python2.5/codecs.py
import codecs # precompiled from /usr/local/lib/python2.5/codecs.pyc
import _codecs # builtin
# /usr/local/lib/python2.5/encodings/aliases.pyc matches /usr/local/lib/python2.5/encodings/aliases.py
import encodings.aliases # precompiled from /usr/local/lib/python2.5/encodings/aliases.pyc
# /usr/local/lib/python2.5/encodings/utf_8.pyc matches /usr/local/lib/python2.5/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/local/lib/python2.5/encodings/utf_8.pyc
Python 2.5.1 (r251:54863, Dec 14 2007, 14:47:12)
[GCC 4.2.3 20071030 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
# /usr/local/lib/python2.5/atexit.pyc matches /usr/local/lib/python2.5/atexit.py
import atexit # precompiled from /usr/local/lib/python2.5/atexit.pyc
Traceback (most recent call last):
  File "/etc/pythonstart", line 7, in <module>
    import readline
ImportError: No module named readline
>>>   
Mein Betriebssystem is Suse 10.3.

Es tut mir Leid für mein Deutsch, höffentlich können Sie mir verstehen!

Vielen Dank
Stuart

Verfasst: Montag 17. Dezember 2007, 19:00
von Leonidas
Hallo Stuart, willkommen im Forum,

Deine Python-Installation scheint ein wenig kaputt zu sein. Hast du das von Suse mitgeliferte Python verwendet oder selbst eines gebaut?

Und dein deutsch ist gar nicht mal so schlecht :)

Verfasst: Montag 17. Dezember 2007, 19:49
von StuL
Danke schön für Ihre Antwort!

Ich habe Python von Suse installiert. Ich habe auch Python 2.4 versucht, das ich von Python gefunden habe aber leider das gibt's nichts.

Können Sie mir helfen, Python zu installieren?

Vielen Dank nochmal! :-)

Verfasst: Montag 17. Dezember 2007, 20:07
von BlackJack
SuSE installiert Python nach `/usr/local/`!? Das wäre zumindest ungewöhnlich.

Verfasst: Montag 17. Dezember 2007, 20:25
von StuL
BlackJack hat geschrieben:SuSE installiert Python nach `/usr/local/`!? Das wäre zumindest ungewöhnlich.
Ja, ich habe gehört, dass es normalerweise /usr ist, oder? Is das das Problem? Wenn so, wie kann ich es lösen?

Verfasst: Montag 17. Dezember 2007, 21:17
von Leonidas
Du solltest erstmal versuchen das von dir kompilierte Python loszuwerden. Das ist nämlich falsch eingerichtet und daher funktioniert es auch nicht richtig.

Für alle (also nicht nur du speziell): Leute, hört doch auf euch unter Linux die Tarballs zu kompilieren. Eure Distribution bringt in aller Regel ein Python mit, welches garantiert funktioniert, auch wenn es vielleicht nicht das aktuellste ist. Python selbst zu kompilieren ist nicht ganz einfach, denn um ein voll funktionsfähiges Python zu haben benötigt man recht viele Abhängigkeiten (etwa readline, libbz2, zlib, gettext, sqlite, ncurses, tk, libdb, libgdbm, blt, openssl, libffi) und kann mit einem falsch konfigurierten Python viele von der Distribution mitgelieferte Programme außer Gefecht setzen. Also: bitte macht das nicht.