Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zlib error #6154

Closed
shelbyKiraM opened this issue Jul 4, 2015 · 9 comments
Closed

Zlib error #6154

shelbyKiraM opened this issue Jul 4, 2015 · 9 comments

Comments

@shelbyKiraM
Copy link

@shelbyKiraM shelbyKiraM commented Jul 4, 2015

On Mac OS 10.11 El Capitan, on run, I get a zlib error. It's both in the OS and installed by Homebrew, not sure why I'm getting this.

$ youtube-dl "https://www.youtube.com/watch?v=8AhA9gx2n6E"
/usr/local/opt/python/bin/python2.7: can't decompress data; zlib not available

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 4, 2015

Maybe the python is misconfigured, but I don't know why it is trying to use zlib because the youtube-dl file is a zip file. What happens if you run the following statements in python?:

$ python
Python 2.7.10 (default, Jul  3 2015, 01:26:20)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import zipfile
>>> import zipimport
>>> import zlib

Also is that the only message you get? What happens if you use the -v option?

@shelbyKiraM
Copy link
Author

@shelbyKiraM shelbyKiraM commented Jul 4, 2015

$ youtube-dl --verbose "https://www.youtube.com/watch?v=8AhA9gx2n6E"
/usr/local/opt/python/bin/python2.7: can't decompress data; zlib not available

$ python2
Python 2.7.10 (default, Jul  4 2015, 11:02:28)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import zipfile
>>> import zipimport
>>> import zlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named zlib
>>> 

Additionally, when I try to run python it says: zsh: command not found: python3 but when I try to run brew install python3 it dies on zlib.

I'm trying brew install python3 --universal now.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 5, 2015

Note that unless you have a python in your PATH symlinked to a python3 executable, youtube-dl will use python 2.x (2.7 in your case) so installing python3 wouldn't solve anything. But you can try running python3 $(which youtube-dl) and see if it also fails.

@shelbyKiraM
Copy link
Author

@shelbyKiraM shelbyKiraM commented Jul 5, 2015

Turns out I had alias python='python3' In my .zshrc

@shelbyKiraM
Copy link
Author

@shelbyKiraM shelbyKiraM commented Jul 5, 2015

And I can't get python3 because of a zlib error.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 5, 2015

I guess that /usr/local/opt/python/bin/python2.7 is provided by Homebrew, you could try with the python provided by OS X: run /usr/bin/python $(which youtube-dl) and execute the commands I gave in /usr/bin/python.

@shelbyKiraM
Copy link
Author

@shelbyKiraM shelbyKiraM commented Jul 8, 2015

Works fine, using system python. >.<

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 8, 2015

I'm going to close the issue then, it's either a problem in the build from Homebrew or a bug in python (the version from OSX is probably a bit older).

@jaimeMF jaimeMF closed this Jul 8, 2015
@snshn
Copy link

@snshn snshn commented Dec 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.