'VS Code ModuleNotFoundError: No module named HttpTrigger1

I'm new to VS Code. I have __init__.py and UploadToGCS.py. I'm trying to use my file UploadToGCS.py. I read many questions with answers, but got more confused.

When I import as follows:

import logging
import azure.functions as func
from HttpTrigger1.UploadToGCS import *

I see error:

ModuleNotFoundError: No module named 'HttpTrigger1'

I tried adding to launch.json in "configurations": []:

1:

{
  "name": "Python: Module",
  "type": "python",
  "request": "launch",
  "module": "UploadToGCS"
},

2:

{
  "name": "Python: Current File",
  "type": "python",
  "request": "launch",
  "program": "${file}",
  "console": "integratedTerminal",
  "cwd": "${workspaceFolder}",
  "env": {
    "PYTHONPATH": "${cwd}"
  }
}

There is also task.json, but I don't know how it works.

How can I use it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source