skip to Main Content

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


  1. It is a possibility that you might be missing a virtual environment. You can install the virtualenv to your environment first and install azure-data-tables once again.

    Install Virtual Environment

    pip3 install virtualenv
    

    Create Virtual Environment

    Python3 -m venv <Your_Virtual_Environment_Name>
    

    Activate Virtual Environment

    <Your_Virtual_Environment_Name>ScriptsActivate.ps1
    

    Get Requirements.txt

    pip3 freeze > requirements.txt
    

    REFERENCES: virtual environment

    Login or Signup to reply.
  2. Because python package names cannot contain hyphens. Please replace the package name ( azure-data-tables ) imported in your code with azure.data.tables or azure_data_tables.

    enter image description here

    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.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search