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

Add installation instructions #523

Closed
DrHyde opened this issue Nov 12, 2012 · 6 comments
Closed

Add installation instructions #523

DrHyde opened this issue Nov 12, 2012 · 6 comments

Comments

@DrHyde
Copy link

@DrHyde DrHyde commented Nov 12, 2012

It's not obvious how to install this application, what it's pre-requisites are, and where to get them from:

$ git clone git://github.com/rg3/youtube-dl.git
Cloning into youtube-dl...
...
$ cd youtube-dl/
$ make
Could not find platform independent libraries
Could not find platform dependent libraries
Consider setting $PYTHONHOME to [:]
'import site' failed; use -v for traceback
Could not import runpy module
pandoc -s -w man README.md -o youtube-dl.1
make: pandoc: Command not found
make: *** [youtube-dl.1] Error 127

Yes, I do have python installed!

$ dpkg -l|grep python
ii python 2.6.6-3+squeeze7 interactive high-level object-oriented language (default version)
...

@Tailszefox
Copy link
Contributor

@Tailszefox Tailszefox commented Nov 12, 2012

Those errors sound pretty weird, but it seems make gives up when it tries making the documentation, though. Do you have pandoc installed? (I assume you're running Ubuntu or Debian or the like, so a simple sudo apt-get install pandoc should do the trick.)

If you still get those errors after installing pandoc, try running make youtube-dl. And if you still get errors after that, try running the commands in the Makefile one by one to see which one fails. Here they are, as a reminder:

zip --quiet --junk-paths youtube-dl youtube_dl/*.py
echo '#!/usr/bin/env python' > youtube-dl
cat youtube-dl.zip >> youtube-dl
rm youtube-dl.zip
chmod a+x youtube-dl
@phihag
Copy link
Contributor

@phihag phihag commented Nov 26, 2012

As a user,

wget https://github.com/rg3/youtube-dl/blob/master/youtube-dl
chmod a+x youtube-dl

should do.

It's documented as such on http://rg3.github.com/youtube-dl/download.html . I'm pretty sure

Could not find platform independent libraries 
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
'import site' failed; use -v for traceback
Could not import runpy module

points to internal errors.

I cannot reproduce these errors on a brand-new debian squeeze with exactly your commands (after running sudo apt-get install -y make git zip). On what system are you? What is the value of the environment variable $PYTHONPATH?

@DrHyde
Copy link
Author

@DrHyde DrHyde commented Nov 27, 2012

@Tailszefox: after installing pandoc like that, 'make youtube-dl' worked, in that it produced a file with the x bit set, but it still doesn't run:

$ ./youtube-dl l93b1o5RtxA
Could not find platform independent libraries
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to [:<exec_prefix>]
'import site' failed; use -v for traceback
Could not import runpy module

@phihag: I'm on Debian 6.0.5. There's no $PYTHONPATH. /usr/bin/python is version 2.6.6. After installing pandoc (I assumed it was part of python so didn't think to install it seperately) 'make' complains thus:

$ make
Could not find platform independent libraries
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to [:<exec_prefix>]
'import site' failed; use -v for traceback
Could not import runpy module
pandoc -s -w man README.md -o youtube-dl.1
pandoc: README.md: hGetContents: invalid argument (Invalid or incomplete multibyte or wide character)
make: *** [youtube-dl.1] Error 1

@Tailszefox
Copy link
Contributor

@Tailszefox Tailszefox commented Nov 27, 2012

Have you tried setting the $PYTHONHOME variable to point to your installation? I would assume it is in /usr/lib/python2.6, though it may be somewhere else.

Try running the command like this, substituting the path for the appropriate one:

% env PYTHONHOME=/usr/lib/python2.6 ./youtube-dl

EDIT : Okay, I'm able to reproduce this by putting a bogus PYTHONHOME, which I suppose is the issue here. I'll keep looking into it.

EDIT 2 : As far as I can tell, this can happen if your $PYTHONHOME and/or $PYTHONPATH variable point to a different version than the one you're using when calling python. This is what I get when I try to run Python 2.6.6 with 2.7 libraries, for example:

% env PYTHONHOME=/usr/lib/python2.7 python 
'import site' failed; use -v for traceback
Python 2.6.6 (r266:84292, Nov 27 2012, 23:32:12) 
[GCC 4.6.3] on linux3
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Do you get the same kind of error if you try to simply run python ?

@DrHyde
Copy link
Author

@DrHyde DrHyde commented Nov 27, 2012

yes indeed:

$ which python
/usr/bin/python
$ python
Could not find platform independent libraries
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to [:<exec_prefix>]
'import site' failed; use -v for traceback
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.

There are several py* directories in /usr/lib:

$ ls -ld /usr/lib/py*
drwxr-xr-x 2 root root 4096 Jul 6 14:10 /usr/lib/pymodules
drwxr-xr-x 3 root root 4096 Jan 30 2011 /usr/lib/python2.4
drwxr-xr-x 3 root root 4096 Jan 30 2011 /usr/lib/python2.5
drwxr-xr-x 2 root root 16384 Jul 6 14:10 /usr/lib/python2.6

I presume that the two ancient ones are lurking remnants from an older install of python which has since been upgraded to 2.6 - at some point this machine got dist-upgraded.

@DrHyde
Copy link
Author

@DrHyde DrHyde commented Nov 27, 2012

Anyway, this looks like a problem with my python install, and not with youtube-dl, so I'm gonna close the issue.

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.