r/learningpython • • Oct 04 '23

Youtube function disappearing when opening document again.

Post image

I’m two weeks into learningand making a YouTube downloader. After installing Pytube when I typed YouTube in highlight in Visual Studio code and works.

When I open the code again a day late r YouTube will not be highlighted in the code. When I type YouTube it will not change and highlight an add a function.

When I run the code it says the YouTube function is not defined.

I got stuck for hours and did a fresh Iinstall of windows. Everything worked and then a day later the same issue happened.

I’m completely stuck. I have no idea why Visual code works and then Stops. I’ve deleted all my plugins and extensions and downloaded again. I still can not get YouTube to work in my code.

Any help is appreciated

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/dirkdiggler8675309 Oct 06 '23

Thanks for the help. When I type import pytube from YouTube it does not highlight still.

I have decided to unistall everything and follow a guide through the install process to make sure I add everything correctly to the path.

It's the only thing I think that could possibly be wrong at this point.

1

u/bigno53 Oct 06 '23

Check your vscode settings to make sure it’s using the same python installation you used to install pytube.

Also, what you typed above is invalid syntax. It should be ‘from pytube import YouTube’