简体   繁体   中英

how can I fix httplib2, oauth2client and apiclient libraries not importing in vscode python?

this is my import codes, and I pip install all the files I should:

from apiclient import errors, discovery
import oauth2client
from oauth2client import client, tools, file
import httplib2

And this is the error for all of them:

Import "httplib2" could not be resolved from sourcePylancereportMissingModuleSource
Import "oauth2client" could not be resolvedPylancereportMissingImports
Import "apiclient" could not be resolvedPylancereportMissingImports

I use windows system. Please help me fix these problems.

First make sure you have installed all the packages in the code using pip command. You can check package installation information with pip show package_name .

包安装信息

Then follow these steps:

  1. Open the command palette with Ctrl + Shift + P ( Or click the python version in the lower right corner of the interface ).

    在此处输入图像描述

  2. Type and select Python:Select Interpreter .

    在此处输入图像描述

  3. Choose the correct interpreter.

    在此处输入图像描述

This will solve your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM