No module named zlib found

坚强是说给别人听的谎言 提交于 2019-12-01 06:07:11
big

I tried following which helped me with some of these modules.
You have to edit setup.py.
Find the following lines in setup.py:

lib_dirs = self.compiler.library_dirs + [
   '/lib64', '/usr/lib64',
   '/lib', '/usr/lib',
   ]

For 64 bit
Add /usr/lib/x86_64-linux-gnu:

lib_dirs = self.compiler.library_dirs + [
   '/lib64', '/usr/lib64',
   '/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu',
   ]

For 32 bit
Add /usr/lib/i386-linux-gnu:

lib_dirs = self.compiler.library_dirs + [
   '/lib64', '/usr/lib64',
   '/lib', '/usr/lib', '/usr/lib/i386-linux-gnu',
   ]

Note x86_64-linux-gnu & i386-linux-gnu might be located somewhere else in your system so path accordingly.

Ater this you will be left with only following modules:

_bsddb             bsddb185           dbm             
gdbm               sunaudiodev  

I solved the problem adding LDFLAGS=-L/usr/lib/x86_64-linux-gnu as configure parameter.

I wrote a note for myself addressing your problem, might be helpful: python installation.

Do you really need bsddb and sunaudiodev modules? You might not want to since both are deprecated since python 2.6

I had this exact problem (exact python distribution as well) Dmity's answer almost worked... but after many hours searching I think I have found the issue (assuming you are using ubuntu 11.10 - 12.10)

Ok, so for me at least the problem stemmed from the fact that Ubuntu disabled SSLv2, so the workaround is fairly involved. Basically you have to delve into the source code and remove all references to SSLv2 before you build it, in addition to adding library paths to your setup file. I followed this tutorial and now I have a working virtualenv with python-2.6.8:

http://ubuntuforums.org/showthread.php?t=1976837

(The patches are fairly easy to implement without using patch) Hope this helps clear up the issues. PHEW

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!