ImportError: cannot import name 'YoutubeSearch'
See original GitHub issueHey, I’m pretty sure this issue is my own fault, but whenever running the example code given I get the error:
"ImportError: cannot import name 'YoutubeSearch'"
I’ve tried installing the library on both windows and linux (I use the windows terminal), both through:
pip (or pip3) install youtube_search
and through github via
pip (or pip3) install git+https://github.com/joetats/youtube_search.git
This is the example code:
from youtube_search import YoutubeSearch
results = YoutubeSearch(‘search terms’, max_results=10).to_json()
print(results)
returns a json string
########################################
results = YoutubeSearch(‘search terms’, max_results=10).to_dict()
print(results)
returns a dictionary
I also have pytube installed if that affects anything?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
cannot import name "Youtube"? - python - Stack Overflow
I need help, I got stuck with a problem inside of my python code. I have installed pytube module from ...
Read more >ImportError: cannot import name 'YouTube' from 'pytube' #564
Depends on the issue. It could mean those scripts don't exist anymore. It could mean your IDE doesn't know they exist.
Read more >cannot import name 'youtube' from partially initialized module ...
Python3.8 pytube ImportError: cannot import name 'YouTube' from 'pytube' ... from pytube import YouTube, Search screen = Tk() title = screen.title('Baixe ...
Read more >Python Code Samples | YouTube Data API - Google Developers
from oauth2client.tools import argparser, run_flow # The CLIENT_SECRETS_FILE variable specifies the name of a file that contains
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Super sorry, whole thing was my own stupid mistake. I made a file called youtube_search.py and later abandoned it to test using a different filename, meaning that all the files in the test folder were trying to read my youtube_search file instead of the library. Deleting the youtube_search.py that I made fixed all my issues, thanks.
Didn’t mean to close, I have fat fingers.