melvinchia3636/YouTube-Scraping-API

Module can't be imported from the code

Closed this issue · 3 comments

When I run a code file with this line:

from youtube_scraping_api import YoutubeAPI

I get the error

ImportError: cannot import name 'YoutubeAPI' from 'youtube_scraping_api' (C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\youtube_scraping_api\__init__.py)

But when I run the same code in your test.py file in src folder, it runs OK.

I think the error is caused by the import, that impors __init__.py from the folder in src, but not my Python package folder site-packages, as they have the same name, but not the same contents. I'll try to fix it by moving folders and code, but that's a critical bug.

Thanks for your issue report. I'll try fixing the bug as soon as possible.

the package should work just fine when installing through PyPi. Take a look at https://ytsa.thecodeblog.net/en/latest/installation.html

Thanks! The import works just fine.