Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to use the youtube video downloader youtube-dl but when trying to use for downloading videos I get

Traceback (most recent call last):
File "/usr/bin/youtube-dl", line 29, in <module>
 import gzip
File "/usr/local/lib/python2.5/", line 9, in <module>
import zlib
ImportError: No module named zlib

Any help????

share|improve this question
How you installed youtube-dl ? From repository or from source – Tachyons Nov 18 '12 at 1:59
I installed it using sudo apt-get – Muhammad Nov 18 '12 at 8:27
Python 2.5? You are doing something wrong, try removing the Python 2.5 installation in /usr/local. You are potentionally breaking your whole Ubuntu installation. – Lekensteyn May 2 '13 at 22:22

You could try to update the software using the embedded update function :

sudo youtube-dl --update

Maybe this could solve some bugs/problems.

share|improve this answer

youtube-dl fails at importing a python module it requires. The error message refers to the module zlib:

sudo apt-get install zlib1g zlib1g-dev

should solve your problem.

share|improve this answer
This is not true, the zlib1g package does not provide python modules. The *-dev package does not provide those either. – Lekensteyn May 2 '13 at 22:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.