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

Traceback of not working youtube-dl installation #939

Closed
AceLine opened this issue Jun 26, 2013 · 15 comments
Closed

Traceback of not working youtube-dl installation #939

AceLine opened this issue Jun 26, 2013 · 15 comments

Comments

@AceLine
Copy link

@AceLine AceLine commented Jun 26, 2013

Hi there forumianers and developers,

I get the following output on my Debian 6.0 console after installing youtube-dl like described on http://rg3.github.io/youtube-dl/download.html :

ns3:/# youtube-dl "http://www.youtube.com/watch?v=WK_XhKnjDOI"
Traceback (most recent call last):
File "/usr/local/lib/python2.6/runpy.py", line 122, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/local/lib/python2.6/runpy.py", line 34, in _run_code
exec code in run_globals
File "/usr/local/bin/youtube-dl/main.py", line 18, in
File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 608, in main
File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 407, in _real_main
File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 460, in make_HTTPS_handler
AttributeError: 'module' object has no attribute 'HTTPSHandler'

...and if I try to cd to the youtube-dl location it says:

ns3:/# cd /usr/local/bin/youtube-dl
bash: cd: /usr/local/bin/youtube-dl: Not a directory

what have I done wrong...? could anybody give me a hint to solve this issue?

THANX in advance!

AceLine

@phihag
Copy link
Contributor

@phihag phihag commented Jun 26, 2013

It looks like your Python version has been compiled without SSL support. I'll try to reproduce this with a brand-new squeeze installation. In the meantime, you can upgrade to a Python version with SSL support, which should come standard at least in wheezy.

@AceLine
Copy link
Author

@AceLine AceLine commented Jun 26, 2013

Hey Phihag,

thanx for your reply. I tried to install ssl by apt-get install python-openssl but it seams to be the same problem. Do you know any better way to install ssl module for python? Or do I have to recompile it completly new?

Thnx. in advance... AceLine

@phihag
Copy link
Contributor

@phihag phihag commented Jun 26, 2013

It worked fine for me on a brand-new squeeze. How did you install Python? (I used apt-get install -y python) What's the output of

python --version
which python
md5sum $(which python)
dpkg -l python

on your system?

Note that openssl is completely unrelated here. You need the ssl module, which usually comes with Python itself

@AceLine
Copy link
Author

@AceLine AceLine commented Jun 27, 2013

Hi Phihag,

the output of your sequence was:

ns3:/# python --version
Python 2.6.4
ns3:/# which python
/usr/local/bin/python
ns3:/# md5sum $(which python)
cbdc370ceca99933f7370d80d0b7aacd /usr/local/bin/python
ns3:/# dpkg -l python
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=====================================================-=====================================================-==========================================================================================================================
ii python 2.5.2-3 An interactive high-level object-oriented language (default version)

Is it possible that installation didn't work well? Which python version is the main version on my system now...? 2.6.4 or 2.5.2-3??? I have no plan, thanx in advance for your helpfull hints...!

Best regards from Austria,

AceLine

@AceLine
Copy link
Author

@AceLine AceLine commented Jun 27, 2013

Sorry Phihag, I upgraded to squeeze now and the following output occures on your sequence:

ns3:/# python --version
Python 2.6.4
ns3:/# which python
/usr/local/bin/python
ns3:/# md5sum $(which python)
cbdc370ceca99933f7370d80d0b7aacd /usr/local/bin/python
ns3:/# dpkg -l python
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=====================================================-=====================================================-==========================================================================================================================
ii python

Seams like the by apt-get installed version is referenced as the main python installation and the newer one doesn't come to work at all... I'll try to purge the older version now and will give you a status on it.

AceLine

@phihag
Copy link
Contributor

@phihag phihag commented Jun 27, 2013

Oh, that explains it: You have compiled Python yourself and put it into /usr/local/bin. You need Python 2.6 for YoutubeDL, and a lot of sites will break without ssl support, so ou can try two things:

  1. Update your system Python. You can do that with
sudo apt-get update && sudo apt-get install -y python2.6

You can then configure 2.6 to be the default with

update-alternatives --install /usr/bin/python python /usr/bin/python2.6 2

This should yield the following output:

$ /usr/bin/python --version
Python 2.6.6

Then, you can simply uninstall your locally compiled Python version (with sudo rm /usr/local/bin/python).

  1. Alternatively, recompile your local Python with ssl support. Simply having the package openssl-dev installed should suffice.

Since many sites use HTTPS, I don't think we should accomodate installations without SSL support - it would simply break a lot of sites, and be dangerous if you're expecting to be safe against interception (because downloading a pro-democracy video from an oppressive state or so).

Does either of these two options solve your problem?

@AceLine
Copy link
Author

@AceLine AceLine commented Jun 27, 2013

ns3:/# update-alternatives --install /usr/bin/python python /usr/bin/python2.6 2
update-alternatives: using /usr/bin/python2.6 to provide /usr/bin/python (python) in auto mode.
ns3:/# youtube-dl http://www.youtube.com/watch?v=WK_XhKnjDOI
Traceback (most recent call last):
File "/usr/local/lib/python2.6/runpy.py", line 122, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/local/lib/python2.6/runpy.py", line 34, in _run_code
exec code in run_globals
File "/usr/local/bin/youtube-dl/main.py", line 18, in
File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 608, in main
File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 407, in _real_main
File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 460, in make_HTTPS_handler
AttributeError: 'module' object has no attribute 'HTTPSHandler'
ns3:/# python --version
Python 2.6.4
ns3:/# which python
/usr/local/bin/python
ns3:/# md5sum $(which python)
cbdc370ceca99933f7370d80d0b7aacd /usr/local/bin/python
ns3:/# dpkg -l python
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=====================================================-=====================================================-==========================================================================================================================
ii python 2.6.6-3+squeeze7 interactive high-level object-oriented language (default version)

@AceLine
Copy link
Author

@AceLine AceLine commented Jun 27, 2013

How can I delete my self compiled version and make the newest from squeeze the main python?

@phihag
Copy link
Contributor

@phihag phihag commented Jun 27, 2013

sudo rm /usr/local/bin/python should suffice

@AceLine
Copy link
Author

@AceLine AceLine commented Jun 27, 2013

Thank you, that way I did know... but - one last question:

I removed the old version by rm -R /usr/local/bin/python but now - and that's exactely what I expected - the call to python ends up in a bash: /usr/local/bin/python: No such file or directory...

Can you tell me how to solve this or where to find the file python of the new installation to make a ln -s at the old location to the new one?

Thank you very much for your patience,

AceLine

@phihag
Copy link
Contributor

@phihag phihag commented Jun 27, 2013

That's very strange, do you have an alias defined? I.e. what output do you get for

/usr/bin/python --version
/usr/bin/env python --version
which python
$(which python) --version
alias
python2.6 --version
which python2.6

If there is truly no /usr/bin/python (but that would probably result in a different error message), you can create a symlink.

@AceLine
Copy link
Author

@AceLine AceLine commented Jun 28, 2013

Hi, THANX a lot for your help! alias did the job. For people searching for how to do it:

# vi ~/.bashrc

in that file add:

alias python='/usr/local/bin/python2.6'

...save and exit and:

# source ~/.bashrc

thats it...

@phihag: go on with your good work! thnx for all!!! 👍

@AceLine
Copy link
Author

@AceLine AceLine commented Jun 28, 2013

Ahhmmm... Phihag... Only one last question about proxy settings:

How to use a proxy with user credentials? I mean, --proxy 1.2.3.4 is the method to use a proxy server of ip 1.2.3.4 but how can I ad a username:password pair?

thnx. one more in advance,

AceLine

@phihag
Copy link
Contributor

@phihag phihag commented Jun 28, 2013

While defining an alias works, the original problem was most likely an existing alias.

Please do not discuss multiple items in a single issue, but instead, open a new one (don't worry, that's free of charge). You should be able to use --proxy http://username:password@1.2.3.4/.

@phihag phihag closed this Jun 28, 2013
@AceLine
Copy link
Author

@AceLine AceLine commented Jun 28, 2013

Thank you for your kindness!

Best regards,

AceLine

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
2 participants
You can’t perform that action at this time.