1

My setting: Ubuntu 10.04, Dropbox SDK 1.5.1, and python 2.7.3

I am setting up the Dropbox SDK, but encounter a problem.

My python works fine, but when I was executing

python setup.py install

to install Dropbox SDK, it shows a message

Traceback (most recent call last):
  File "setup.py", line 6, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools

I googled this message and found that I don't have setuptools. So I turned to install python setuptools. However, I failed again.

I tried to execute

sudo apt-get install python-setuptools

but the installation of Dropbox shows the same message.

I also went to http://pypi.python.org/pypi/setuptools downloading the file setuptools-0.6c11-py2.7.egg Then I executed

sudo sh setuptools-0.6c11-py2.7.egg

However, I got another error message

Traceback (most recent call last):
  File "<string>", line 1, in <module>
zipimport.ZipImportError: can't decompress data; zlib not available

I found that probably I further need to install zlib related stuffs. Thus, I followed the advice to execute

sudo apt-get install zlib1g-dev

but the situation seems to be the same. I always got the message

Traceback (most recent call last):
  File "<string>", line 1, in <module>
zipimport.ZipImportError: can't decompress data; zlib not available

I even used Ubuntu's Synaptic package manager, and checked and installed every package with zlib keyword. But I still have the same problem.

Could anyone give me some advice of how can I install Dropbox SDK in Ubuntu 10.04?

user4478
  • 1,289
  • 2
  • 11
  • 13

2 Answers2

1

For anyone coming across this looking for an answer, the following command:

sudo apt-get install python-setuptools

will properly set up setuptools, then

sudo python setup.py install

will work. Cheers

0

For 64 bit

sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 /lib/libz.so

For 32 bit

sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib

Also install:

lib32z1 & lib32z1-dev for 32 bit packages

Satish
  • 16,544
  • 29
  • 93
  • 149
  • This does not work. I executed it. I again tried "sudo sh setuptools-0.6c11-py2.7.egg" but it showed the same zlib1g error message. I tried "sudo python setup.py install" and it showed the same setuptools error message – user4478 Feb 14 '13 at 18:17
  • Try this: wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz tar zxvf setuptools-0.6c11.tar.gz cd setuptools-0.6c11 python setup.py build python setup.py install – Satish Feb 14 '13 at 18:20
  • I have already tried these instructions... but they did not work – user4478 Feb 14 '13 at 18:23
  • Run apt-get build-dep python and try setuptool again – Satish Feb 14 '13 at 18:26
  • Its 32bit or 64bit? If 32bit then install lib32z1 – Satish Feb 14 '13 at 18:28
  • I am not sure whether my ubuntu is 32 bit, but saw some "i386" keyword. So I assume it is 32 bit. Then, where or which instruction should I use lib32z1? – user4478 Feb 14 '13 at 18:35
  • Run uname -a ( i386 or i686 or X86 – 32 bit systems ) (x86_ 64 - 64 bit systems) – Satish Feb 14 '13 at 18:37
  • Go ahead and install lib32z1 & lib32z1-dev for 32 bit packages – Satish Feb 14 '13 at 18:44
  • already done "apt-get build-dep python" but still failed to run "sudo sh setuptools-0.6c11-py2.7.egg" – user4478 Feb 14 '13 at 18:44
  • i tried "sudo apt-get install lib32z1" and "sudo apt-get install lib32z1-dev" but it shows "couldn't find package" error message – user4478 Feb 14 '13 at 18:46
  • It seem your python doesn't know about zlib, so i would say download python source and recompile with zlib support. – Satish Feb 14 '13 at 18:46
  • Run find . -name libz.so and let us know where is zlib.so located – Satish Feb 14 '13 at 18:47
  • Try this one. sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib – Satish Feb 14 '13 at 18:48
  • sorry my bad! running "find . -name libz.so" shows "./libz.so" and running "find / -name libz.so" shows /lib/libz.so and /usr/lib/libz.so – user4478 Feb 14 '13 at 18:54
  • Now you have no choice except download python and recompile it. – Satish Feb 14 '13 at 18:56
  • for some reason I want to use python 2.7. I plan to download "Python 2.7.3 compressed source tarball" version from http://www.python.org/getit/ Do you think whether this version is suitable? Or I need to additionally install libz or something else? Besides, could you please explain more details about why I have such problem? – user4478 Feb 14 '13 at 18:59
  • Here is your problem: http://stackoverflow.com/questions/4047212/installing-python-2-7-on-ubuntu-10-4 – Satish Feb 14 '13 at 19:05
  • I checked this post before, trying to fix my problem. Apparently I failed. The worst is I still cannot understand what they mean but just follow the instruction they gave – user4478 Feb 14 '13 at 19:08
  • You can install python2.7 in your home directory using following command. download source and untar it and ./configure --prefix=/home/user/python2.7 and make && make install – Satish Feb 14 '13 at 19:12
  • It won't disturb your existing installation, but you need to run it with full path like /home/user/python2.7/bin/python2.7 – Satish Feb 14 '13 at 19:15
  • Ah.. I removed the original python and then re-installed another one. But still cannot setup dropbox sdk successfully. Still have the same problem... – user4478 Feb 14 '13 at 20:08
  • re-install? You mean say apt-get or source compile? – Satish Feb 14 '13 at 20:37
  • I got the source and compiled (./configure + make + make install) again – user4478 Feb 15 '13 at 09:03
  • Seem to be weird. I have another Ubuntu 11.1 virtual machine. I just installed python and run "apt-get install python-setuptools". Then, magically everything is fine (running python setup.py install for dropbox SDK is ok) – user4478 Feb 15 '13 at 09:06
  • I don't know why your compiling thing doesn't work! It should work if all goes well. also it required some basic system level knowledge to troubleshoot things. – Satish Feb 15 '13 at 15:24