4

I've been trying to use the Pytube module and every time I use its Client attribute it keeps coming up with the following error:

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    client = pytube.Client('my-app-identifier')
AttributeError: 'module' object has no attribute 'Client'
klutt
  • 30,332
  • 17
  • 55
  • 95
Abdilatif Musa
  • 105
  • 1
  • 2
  • 4
  • Sounds like the `pytube` object doesn't have a `Client` attribute. Are you using a tutorial or documentation that implies that it does? Got a link? – Kevin Dec 29 '15 at 17:55
  • I am using the documentation heres the links: https://pypi.python.org/pypi/pytube/5.1.0 https://pytube.readthedocs.org/en/latest/overview.html – Abdilatif Musa Dec 29 '15 at 18:24
  • Are you sure that the documentation from your second link is for the library in your first link? The docs seem to be written by "Noah Silas" and the library by "Nick Ficano". Isn't it possible that they're two unrelated projects that happen to share a name? – Kevin Dec 29 '15 at 19:01

2 Answers2

3

First of all, the latest version of pytube (which gets installed with pip install pytube is today the version 6.1.5; so you should probably be looking at that version's PyPI page instead. The brief documentation on the PyPI page says nothing about the Client class; instead the main API class is YouTube, as shown in this excerpt:

from pytube import YouTube
yt = YouTube("http://www.youtube.com/watch?v=Ik-RsDGPI5Y")

# Once set, you can see all the codec and quality options YouTube has made
# available for the perticular video by printing videos.

pprint(yt.get_videos())

The "PyTube" documentation at Read the Docs seems to be for a completely unrelated project. As far as I can see, this project is not available on PyPI.

3
  • The “PyTube documentation” you are looking at is for the PyTube, a library written by Noah Silas and Kai Powell, available on GitHub. The library hasn’t been updated in 5 years, and with YouTube’s many changes, it’s likely that it will no longer work.

  • The pytube library available from PyPI is a completely different library written by Nick Ficano and does not really come with a lot of documentation. Instead, the only manual is on the GitHub project page.

poke
  • 369,085
  • 72
  • 557
  • 602