Ich habe Python 2.7 auf meinem Ubuntu Lucid kompiliert und installiert.
Ich kann setuptools für Python 2.7 jedoch nicht installieren, da das Datendekomprimierungsmodul zlib nicht vorhanden ist. Das ist der genaue Fehler:
Traceback (most recent call last):
File "setup.py", line 94, in <module>
scripts = scripts,
File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/rohan/setuptools-0.6c11/setuptools/command/install.py", line 76, in run
self.do_Egg_install()
File "/home/rohan/setuptools-0.6c11/setuptools/command/install.py", line 96, in do_Egg_install
self.run_command('bdist_Egg')
File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/rohan/setuptools-0.6c11/setuptools/command/bdist_Egg.py", line 236, in run
dry_run=self.dry_run, mode=self.gen_header())
File "/home/rohan/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.7/zipfile.py", line 651, in __init__
"Compression requires the (missing) zlib module"
RuntimeError: Compression requires the (missing) zlib module
Wenn ich versuche, setuptools 2.7 .Egg zu verwenden, gibt es diesen Fehler:
Traceback (most recent call last):
File "<string>", line 1, in <module>
zipimport.ZipImportError: can't decompress data; zlib not available
Sie haben vergessen, zlib1g-dev
zu installieren, bevor Sie Python erstellen.
Installieren Sie zuerst die Begleiter mit dem folgenden Befehl
yum install zlib
yum install zlib-devel
dann remake Python
make
make install
Bitte installieren Sie dies, bevor Sie fortfahren.
Sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev\
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev
Meine Lösung für dieses Problem ist etwas anders, nur weil ich versucht habe, Python auf einem Remote-Computer zu installieren, auf den ich als Rootbenutzer nicht zugreifen kann UND keinen Zugriff auf das Internet hat. Hier ist meine leicht modifizierte Lösung:
Das funktioniert zwar nicht für alle, aber heute hat es funktioniert.