question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name 'quote' from 'pytube.compat'

See original GitHub issue

When I try to run

from pytube import Youtube

It crashes and emits this error

ImportError: cannot import name 'quote' from 'pytube.compat'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:24
  • Comments:19

github_iconTop GitHub Comments

103reactions
PekitPcommented, Mar 20, 2020

pip install pytube3 worked for me

23reactions
orlovdumitrucommented, Aug 16, 2021

For Linux -> install library:

pip uninstall pytube
pip install pytube3

-> inside:

pip/pytube/extract.py

-> find:

parse_qs(formats[i]["cipher"]) for i, data in enumerate(formats)

-> and change it to:

parse_qs(formats[i]["signatureCipher"]) for i, data in enumerate(formats)

-> how to use pytube:

from pytube import YouTube
import os
def downloadYoutube(vid_url, path):
    yt = YouTube(vid_url)
    yt = yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first()
    if not os.path.exists(path):
        os.makedirs(path)
    yt.download(path)

url = input('Input url:\n')
path = input('Path to store file:\n')
downloadYoutube(url, path)
Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: cannot import name 'quote' - python
I found this github issue with a possible solution: ImportError: cannot import name 'quote' from 'pytube.compat' pip uninstall pytube pip ...
Read more >
ImportError: cannot import name 'quote' from 'pytube.compat...
I got this error: ImportError: cannot import name 'quote' from 'pytube.compat'. Then I installed pytube3 - now it works. Thank you a lot...
Read more >
[Example code]-ImportError: cannot import name 'quote'
I found this github issue with a possible solution: ImportError: cannot import name 'quote' from 'pytube.compat' pip uninstall pytube pip install pytube3.
Read more >
How to Fix : “ImportError: Cannot import name X” in Python?
You can solve the “ ImportError : Cannot import name X” Error by resolving the circular dependencies. You can do that either by...
Read more >
python pytube模块运行报错 - CSDN博客
python pytube 模块运行报错:from pytube.compat import quote ImportError: cannot import name 'quote' · 一、说明: · 解决思路:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found