Pytube: Failed to import YouTube

Created on 16 Apr 2018  路  6Comments  路  Source: pytube/pytube

pytube version 9.2.2
Every time I try to use the PYTUBE module it shows this error.

from pytube import YouTube
ImportError: cannot import name 'YouTube'

installed pytube using pip
pip install pytube

All 6 comments

Is this still a problem? Did you manage to solve it?

problem already solved.
Thank you.

小泻邪蟹邪谢 斜褘 褏芯褌褜, 泻邪泻懈屑 芯斜褉邪蟹芯屑 芯薪邪 褉械褕懈谢邪褋褜.

For my case the decision was reinstall pytube and delete .pyc files (Linux(ubuntu)) (find . -name '*.pyc' -delete)

Hello, I also had this error, and fixed it using EllainYang's comment. Just to clarify for anyone in the future who has this issue.

  1. I uninstalled pytube3 from command line: >pip uninstall pytube3
  2. I reinstalled pytube3 from command line: >pip install pytube3
  3. Step 2 returns the filepath where pytube3 was installed. I went to the folder that was returned, opened "pytube/", and cleared the contents of the '__pycache__' folder, which has all the ".pyc" files. These are not important and can be regenerated by the package whenever it is loaded.
  4. I opened python and successfully ran: >>>from pytube import YouTube
    Don't forget to capitalize the T!

Capitalize the "T" in YouTube, solved it for me
from pytube import YouTube

Was this page helpful?
0 / 5 - 0 ratings

Related issues

twwwy picture twwwy  路  54Comments

kpister picture kpister  路  23Comments

RONNCC picture RONNCC  路  20Comments

harindu95 picture harindu95  路  20Comments

haroldfry picture haroldfry  路  58Comments