Import could not be resolved in VS Code

Krishnamohan Nadimpalli 406 Reputation points
2022-11-17T13:04:01.237+00:00

I am trying to write a code in Azure Functions through VS Code, but in import it says "Import could not be resolved". Following is screenshot

Python is installed, Azure Storage Account is installed

261413-image.png

Do I need to put them in some file or settings library.? And also pip install mysql-connector as per some docs is not working

261446-image.png

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,643 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 69,991 Reputation points
    2022-11-18T07:11:41.557+00:00

    @Krishnamohan Nadimpalli Thanks for reaching out. For your first issue Import could not be resolved in VS Code for pandas it will resolve once the panda is installed on your function environment locally. Please make sure that you are adding all the dependencies in requirement.txt file for any package management.

    In case if those module or dependencies cannot be installed using pip then you need to use build native dependencies or enable remote build.
    You can refer to python troubleshooting document for more details.

    For your second error the error is expect as Mysql-connector is deprecated as per the project description, and you should use mysql-connector-python and when we try to install the package it doesn't found any distributor with that name as is already deprecated.

    Please refer to the Azure Functions Python developer guide to get started with python azure function.


0 additional answers

Sort by: Most helpful