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

need help installing version from different fork #32887

Closed
ginahoy opened this issue Jul 31, 2024 · 9 comments
Closed

need help installing version from different fork #32887

ginahoy opened this issue Jul 31, 2024 · 9 comments
Labels

Comments

@ginahoy
Copy link

ginahoy commented Jul 31, 2024

Checklist

  • [x ] I'm asking a question
  • [x ] I've looked through the README and FAQ for similar question

Question

Last year, to resolve an issue, I was advised in this forum to install a patched version of youtube-dl from this fork. I recently updated from that fork to resolve a new issue, but was advised to switch back to the main fork. However, after installing the latest nightly (7/25), I checked the version and it's still showing the 7/30 build from the patched fork. Here's the terminal log:

xxxxx@linux-desktop ~/Music/youtube-dl $ sudo python setup.py install
running install
running build
running build_py
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/local/bin/youtube-dl to 755
running install_data
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/youtube_dl-2024.07.25.egg-info
Writing /usr/local/lib/python2.7/dist-packages/youtube_dl-2024.07.25.egg-info

xxxxx@linux-desktop ~/Music/youtube-dl $ youtube-dl --version
2024.07.30.40298

I'm not very experienced with Linux commands, but I'm thinking maybe I need to uninstall the 7/30 patched version first. The README file provides this command: sudo apt-get remove -y youtube-dl but the response is: Package 'youtube-dl' is not installed, so not removed... I think that command only applies when youtube-dl was installed using a package manager.

I extracted youtube-dl from the GNU zip file then used setup.py to install, so I searched for a command to uninstall a program installed with setup.py and found this: sudo pip uninstall youtube-dl. When I run that command, I get this error: pip: command not found.

Please advise if I need to uninstall the patched version first and if so, what are the commands for that. Thx.

@aiur-adept
Copy link
Contributor

aiur-adept commented Jul 31, 2024

sudo apt-get remove -y youtube-dl fails because you didn't install it using the apt package manager. You probably did python setup.py install or maybe used pip.

Now, installing should remove older versions, like you see in the line

Removing /usr/local/lib/python2.7/dist-packages/youtube_dl-2024.07.25.egg-info

So, perhaps figure out where youtube-dl is currently living because the installer can't find it to uninstall. Perhaps was it installed using python3 while here you're using python2.7 to run setup.py?

Check /usr/local/lib/python2.7/dist-packages/ and /usr/local/lib/python3.10/dist-packages/ (replace 3.10 with whatever version you have for 3) and see what versions of youtube-dl are in there (the .egg-info files).

Ultimately, i think pip can find it wherever it's been installed, so try just running sudo pip uninstall youtube-dl or sudo pip3 uninstall youtube-dl

@dirkf
Copy link
Contributor

dirkf commented Aug 1, 2024

which youtube-dl ?
echo $PATH ?

@ginahoy
Copy link
Author

ginahoy commented Aug 3, 2024

Thank you for your replies!

@aiur-adept, yes, as noted my OP, I installed youtube-dl using setup.py, and I tried removing using pip and get the response: pip: command not found (ditto with pip3).

I just checked my python distribution packages and there are three .egg-info files located in the paytyon2.7 folder:

  • youtube_dl-2023.04.14.19419.egg-info
  • youtube_dl-2024.07.25.egg-info
  • youtube_dl-2024.07.30.40298.egg-info

I'm not sure what to do with that information.

@dirkf, here's the output from the commands you suggested:

david@linux-desktop ~ $ which youtube-dl
/usr/local/bin/youtube-dl

david@linux-desktop ~ $ echo $PATH
/home/david/bin:/home/david/.local/bin:/opt/OpenPrinting-Gutenprint/sbin:/opt/OpenPrinting-Gutenprint/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Again, not sure what to do. Learning more about Linux is on my endless list of things I need to do :-)

@dirkf
Copy link
Contributor

dirkf commented Aug 3, 2024

So just acquire the nightly bundled POSIX release, make it executable, and overwrite /usr/local/bin/youtube-dl with it. You'll need to sudo ... the final step.

@ginahoy
Copy link
Author

ginahoy commented Aug 3, 2024

I appreciate your assistance but I'm not familiar with the term 'bundled POSIX release'...

OK, I looked it up -- Portable OS System Interface, but that doesn't tell me which file to grab from the nightly asset list, or how to 'make it executable'.

(If a program isn't included in my distro's repository or the repository version is outdated, I'm usually at a loss on how to proceed. For youtube-dl, the -U parameter worked in the past, but last year, to resolve a different issue, I had to be spoon-fed instructions on where to locate, which file, and how to install a patched fork. It resolved my issue.)

Sorry for being such a dunce. I'm thinking maybe I should take this to a Linux forum.

@aiur-adept
Copy link
Contributor

@ginahoy You can download the nightly builds here:

https://github.com/ytdl-org/ytdl-nightly/releases

You'll want youtube-dl (click this link to download)

Then sudo mv that file to /usr/local/bin/youtube-dl

This is a more direct way to install youtube-dl rather than using setup.py

@dirkf
Copy link
Contributor

dirkf commented Aug 3, 2024

All the help you need is in #30839, in particular the linked "further installation guidance". The online manual is a bit less helpful, at least until #32786 is finished.

Generally, users should only be running the build commands (setup.py, eg) in the youtube-dl distribution as part of some development project, and not just to install the program. Having said that, one thing that we don't make clear, I think, is that a pip installation is recommended if the user wants to use the youtube_dl Python module rather than just running the youtube-dl command.

@ginahoy
Copy link
Author

ginahoy commented Aug 4, 2024

OK, that worked! (Although I fumbled around before I figured out how to make it executable using Thunar file mgr to change file properties.)

The --version option now shows 2024.08.02, and to my amazement, that fixed (at least for me) the current error I was dealing with (HTTP Error 403: Forbidden. Retrying fragment 1 (1/10)...) when downloading a particular audio file (.m4a). Thanks!

I'm still a bit confused as to why the pip command wasn't already installed on my system (re: sudo pip uninstall youtube-dl resulted in command not found error). Seems like my python install would have included the pip command. Sorry, that's more of a rhetorical question as I just found instructions and installed pip.

@dirkf
Copy link
Contributor

dirkf commented Aug 4, 2024

Use python -m pip as the pip command, where python is how you invoke the relevant Python version. If there's apparently no such module, use python -m ensurepip.

A default Python installation comes with pip but a package manager (apt, say) may disable it, on the grounds that it wants to be in charge of installing Python modules. Maybe one or more of your residual yt-dl installations were made with the system package manager?

Also, and obligatory: XKCD 1987.

... to my amazement, that fixed (at least for me) the current error I was dealing with ...

It shouldn't be so surprising since it was the point of the new release, but good to know.

@ginahoy ginahoy closed this as completed Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants