I’m hoping to use azure-data-tables
in my Python code. I’m working in VScode on an Azure HTTP trigger. I’ve run pip3 install azure-data-tables
in the terminal on my Mac. However, when I import azure-data-tables in my file on VS code, it’s underlined in red and does not recognize it. Does anyone have any suggestions of what to try?
2
Answers
It is a possibility that you might be missing a virtual environment. You can install the
virtualenv
to your environment first and installazure-data-tables
once again.Install Virtual Environment
Create Virtual Environment
Activate Virtual Environment
Get Requirements.txt
REFERENCES: virtual environment
Because python package names cannot contain hyphens. Please replace the package name (
azure-data-tables
) imported in your code withazure.data.tables
orazure_data_tables
.In addition, as mentioned above, virtual environments can help you install packages of different functions in different environments, which is convenient for code management and operation.
If multiple python environments exist on your machine, please use CTRL + SHIFT + P to open the command palette, type and select Python: Select Interpreter (or click on the interpreter version displayed in the lower right corner). Then choose the correct python interpreter.