-2

my code start with:

"from pytube import YouTube"
an the error is:
unresolved import 'pytube

How can i inport pytube library?

rioV8
  • 24,506
  • 3
  • 32
  • 49

1 Answers1

0

For the use of the module "pytube" in VS Code, you could refer to the following:

  1. Please check whether the python used by the terminal is the same as the python currently selected (Shown in the lower left corner of VS Code.) by VS Code: (pip --version or python --version)

    enter image description here

    If they are not the same, please use the shortcut key Ctrl+Shift+` to open a new terminal, it will automatically enter the selected environment.

  2. Install the module. (pip install pytube)

  3. Check: (pip show pytube)

    enter image description here

run:

enter image description here

Jill Cheng
  • 9,179
  • 1
  • 20
  • 25