Setuptools mit Python2.6

Probleme bei der Installation?
Antworten
Pyccak
User
Beiträge: 8
Registriert: Mittwoch 30. Dezember 2009, 16:39

Hallo,

ich hab mal für den Python2.6 auf einer anderen Maschine Setuptools installier und es ging ohne Probleme. Jetzt will ich Setuptools auf Debian 5 Lenny installieren bekomme aber diese Fehlermeldung:

Code: Alles auswählen

#python2.6 setup.py install
running install
running bdist_egg
running egg_info
writing setuptools.egg-info/PKG-INFO
writing top-level names to setuptools.egg-info/top_level.txt
writing dependency_links to setuptools.egg-info/dependency_links.txt
writing entry points to setuptools.egg-info/entry_points.txt
reading manifest file 'setuptools.egg-info/SOURCES.txt'
writing manifest file 'setuptools.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-i686/egg
running install_lib
running build_py
copying setuptools.egg-info/PKG-INFO -> build/bdist.linux-i686/egg/EGG-INFO
copying setuptools.egg-info/SOURCES.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying setuptools.egg-info/dependency_links.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying setuptools.egg-info/entry_points.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying setuptools.egg-info/top_level.txt -> build/bdist.linux-i686/egg/EGG-INFO
creating 'dist/setuptools-0.6c11-py2.6.egg' and adding 'build/bdist.linux-i686/egg' to it
Traceback (most recent call last):
  File "setup.py", line 94, in <module>
    scripts = scripts,
  File "/usr/local/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/local/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/home/nakuge/setuptools/setuptools-0.6c11/setuptools/command/install.py", line 76, in run
    self.do_egg_install()
  File "/home/nakuge/setuptools/setuptools-0.6c11/setuptools/command/install.py", line 96, in do_egg_install
    self.run_command('bdist_egg')
  File "/usr/local/lib/python2.6/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/home/nakuge/setuptools/setuptools-0.6c11/setuptools/command/bdist_egg.py", line 236, in run
    dry_run=self.dry_run, mode=self.gen_header())
  File "/home/nakuge/setuptools/setuptools-0.6c11/setuptools/command/bdist_egg.py", line 527, in make_zipfile
    z = zipfile.ZipFile(zip_filename, mode, compression=compression)
  File "/usr/local/lib/python2.6/zipfile.py", line 660, in __init__
    "Compression requires the (missing) zlib module"
RuntimeError: Compression requires the (missing) zlib module
Was ist diese zlib-Modul? Oder besser gefrag wo kriege ich es?

Hab schon zip, unzip, zlib-bin, zlib1g-dev und zlib1g installiert, hat aber alles nicht geholfen. Ich bin auch kein großer könner in Linux oder Python. Gibt es eine andere "einfache" Methode Setuptools zu installieren?

Danke
Zuletzt geändert von Pyccak am Samstag 23. Januar 2010, 23:21, insgesamt 1-mal geändert.
nemomuk
User
Beiträge: 862
Registriert: Dienstag 6. November 2007, 21:49

Code: Alles auswählen

apt-get install python-setuptools
?? Habe hier kein Debian, aber ich bin mir zu 99% sicher, dass es dieses Paket gibt...
Dav1d
User
Beiträge: 1437
Registriert: Donnerstag 30. Juli 2009, 12:03
Kontaktdaten:

Code: Alles auswählen

sh setuptools-0.6c9-py2.6.egg --prefix=~
das geht bei mir einwandfrei

Edit: da hab ichs her: http://pypi.python.org/pypi/setuptools#id4
the more they change the more they stay the same
Pyccak
User
Beiträge: 8
Registriert: Mittwoch 30. Dezember 2009, 16:39

mit "apt-get install python-setuptools" geht es auch wunderbar. Nur leider für Python2.5. Ich möchte es aber für Python2.6 haben, weil das Programm, dass ich mit Python benutzen will diese Version benötigt.

hab mit das jetzt als *.egg runtergeladen. Es kommt aber der selbe Fehler herraus:

Code: Alles auswählen

# sh setuptools-0.6c11-py2.6.egg
Traceback (most recent call last):
  File "<string>", line 1, in <module>
zipimport.ZipImportError: can't decompress data; zlib not available
also hab ich auf Google diese Seite gefunde http://www.zlib.net/ und die "zlib" installiert, abe das hat leider nichts gabracht. Ob das falsche zlibs sind?

scheinbar versucht er etwas bei installation zu zippen, aber das Modul fehl dafür. Ich hab zip installiert, aber erst nach der installation von Python2.6 Ob ich das irgendwie einbinden muss?
fhoech
User
Beiträge: 143
Registriert: Montag 9. April 2007, 18:26

Woher kommt das Python 2.6? Ist es zufällig ein Eigenkompilat? Falls ja, so musst Du Python für zlib-Support neukompilieren, falls zlib-dev erst nach Python installiert wurde (./configure --enable-shared, make clean, make sollte genügen). Dann kannst Du ja schaun, ob ein zlib.so erzeugt wurde.
Pyccak
User
Beiträge: 8
Registriert: Mittwoch 30. Dezember 2009, 16:39

das Python2.6 hab ich runtergeladen und über ./configure,make, make test, make install hab ich es zum laufen gebracht. Also das ist dan kompiliert, glaub ich. kenn mich da nicht so aus.

hab auch die ganzen zlibs erst nach der installation von python installiert.

Ich hab das richtigverstanden? Ich geh in den Ordner mit Python2.6 und geb ein

Code: Alles auswählen

./configure --enable-shared
make clean
make
Ich hab das jetzt so mal gemacht, aber es kommt der selber fehler raus.
fhoech
User
Beiträge: 143
Registriert: Montag 9. April 2007, 18:26

Wurde die zlib.so in dem Python2.6 Verzeichnis erstellt (bzw. einem Unterverzeichnis davon)? Und hast Du den erneuten Test auch mit diesem neukompilierten Python gemacht und nicht mit dem bereits installierten 2.6?
Pyccak
User
Beiträge: 8
Registriert: Mittwoch 30. Dezember 2009, 16:39

ja, der findet zwei "zlibs"

Code: Alles auswählen

# find -name "zlib.so"
./usr/lib/python2.5/lib-dynload/zlib.so
./home/benutzer/python2.6/python2.6-2.6.4/build/lib.linux-i686-2.6/zlib.so
das erste ist beim Python2.5, ist also uninteressant.
das zweite ist in dem Verzeichnes wo ich das Python Paket runtergeladen habe und es von dort aus installiert.

Den test beim Setuptools installieren oder den "make test"? Die Setuptools versuche ich (wenn ich in dem Ordner vom Setuptools bin) mit dem Befehl zu installieren: "python2.6 setup.py install".

EDIT: Sia fragten nach "zlib-dev" das ist das selbe wie "zlib1g-dev"? Weil ich hab nur die nach der Installtion von Python installiert.

EDIT #2: Hab jetzt mal nach "./configure --enable-shared" den "make test" beobachtet und das hier bei zlibs gefunden:

Code: Alles auswählen

...
test_zlib
317 tests OK.
3 tests failed:
    test_httpservers test_multiprocessing test_sundry
45 tests skipped:
    test_aepack test_al test_applesingle test_bsddb test_bsddb185
    test_bsddb3 test_bz2 test_cd test_cl test_codecmaps_cn
    test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
    test_codecmaps_tw test_cprofile test_curses test_dbm test_gdbm
    test_gl test_imgfile test_kqueue test_linuxaudiodev test_macos
    test_macostools test_normalization test_ossaudiodev test_pep277
    test_profile test_pstats test_py3kwarn test_scriptpackages
    test_smtpnet test_socketserver test_sqlite test_ssl test_startfile
    test_sunaudiodev test_tcl test_timeout test_unicode_file
    test_urllib2net test_urllibnet test_winreg test_winsound
    test_zipfile64
9 skips unexpected on linux2:
    test_dbm test_bz2 test_gdbm test_bsddb test_profile test_ssl
    test_tcl test_pstats test_cprofile
make: [test] Error 1 (ignored)
LD_LIBRARY_PATH=/home/benutzer/python2.6/python2.6-2.6.4: ./python -E -tt ./Lib/test/regrtest.py -l
...
Das Ergebnis sieht dan so aus:

Code: Alles auswählen

286 tests OK.
32 tests failed:
    test_httpservers test_multiprocessing test_os test_pipes
    test_platform test_poll test_popen test_popen2 test_pty test_pydoc
    test_quopri test_re test_select test_signal test_site test_str
    test_subprocess test_sundry test_sys test_tempfile
    test_threaded_import test_threading test_threading_local
    test_threadsignals test_tuple test_unicode test_unicodedata
    test_urllib2_localnet test_wait3 test_wait4 test_xmlrpc
    test_zipimport_support
47 tests skipped:
    test_aepack test_al test_applesingle test_bsddb test_bsddb185
    test_bsddb3 test_bz2 test_cd test_cl test_codecmaps_cn
    test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
    test_codecmaps_tw test_cprofile test_curses test_dbm test_gdbm
    test_gl test_imgfile test_kqueue test_linuxaudiodev test_macos
    test_macostools test_normalization test_ossaudiodev test_pep277
    test_profile test_pstats test_py3kwarn test_resource
    test_scriptpackages test_smtpnet test_socketserver test_sqlite
    test_ssl test_startfile test_sunaudiodev test_tcl test_timeout
    test_unicode_file test_urllib2net test_urllibnet test_winreg
    test_winsound test_xml_etree_c test_zipfile64
11 skips unexpected on linux2:
    test_dbm test_bz2 test_gdbm test_bsddb test_profile test_ssl
    test_tcl test_pstats test_xml_etree_c test_resource test_cprofile
make: *** [test] Error 1
Man sieht das der zipimport_support Test (Zeile 10) fehlgeschlagen ist
Zuletzt geändert von Pyccak am Sonntag 24. Januar 2010, 15:05, insgesamt 2-mal geändert.
Leonidas
Python-Forum Veteran
Beiträge: 16025
Registriert: Freitag 20. Juni 2003, 16:30
Kontaktdaten:

Du hast also das neue Python kompiliert, aber noch nicht installiert. Solltest du mal nachholen.
My god, it's full of CARs! | Leonidasvoice vs (former) Modvoice
Pyccak
User
Beiträge: 8
Registriert: Mittwoch 30. Dezember 2009, 16:39

ahh, :oops: danke schön. Hat jetzt geklappt.

Woran lag das jetzt? Also wenn ich das jetzt nochmal auf einem neuen Server installieren muss, muss ich davor die "zlib1g-dev" installieren?

Bei einem anderen Server musste ich nichts installieren (nur Pythonhalt halt). Woher weiß ich wann ich die installieren muss und wnn nicht?
Leonidas
Python-Forum Veteran
Beiträge: 16025
Registriert: Freitag 20. Juni 2003, 16:30
Kontaktdaten:

Pyccak hat geschrieben:Woran lag das jetzt? Also wenn ich das jetzt nochmal auf einem neuen Server installieren muss, muss ich davor die "zlib1g-dev" installieren?
Ja. Du brauchst immer die -dev-Pakete um Software zu kompilieren die die entsprechenden C-Libraries verwendet.
Pyccak hat geschrieben:Bei einem anderen Server musste ich nichts installieren (nur Pythonhalt halt). Woher weiß ich wann ich die installieren muss und wnn nicht?
Wenn Python schon vorkompiliert ist, brauchst du die Pakete natürlich nicht mehr extra zu installieren.
My god, it's full of CARs! | Leonidasvoice vs (former) Modvoice
Antworten