导入 "pytube" 无法解析 pylance (repotMissingImport)

时间:2021-03-17 10:05:07

标签: python visual-studio-code python-import pytube pylance

从 pytube 导入 Youtube

enter image description here

1 个答案:

答案 0 :(得分:0)

根据你提供的信息,我重现了这个问题:

enter image description here

模块安装过程请参考以下内容:

  1. 如果你有多个python环境,请检查VS Code终端是否使用了选择的python环境(显示在VS Code的左下角),如果不一样,请打开一个新的VS代码终端。 (python --version)

    enter image description here

  2. 安装模块“pytube”。 (pip install pytube)

  3. 检查模块的位置:(pip show pytube)

    enter image description here

  4. 然后,请重新加载 VS Code 使其识别此模块:(F1, Developer: Reload Window)

    enter image description here

参考:Python environment in VS Code