Getting ModuleNotFoundError: No module named ‘rpletl”
the function app is not importing the module
the image shows the file directory
I want to import etl.py and execute this in a http trigger
In my HttpTrigger1 i have
<code>from rpletl.etl import main as etl_main
import logging
import sys
from pathlib import Path
from dotenv import load_dotenv
import azure.functions as func
# Set the path to the rpletl module
sys.path.append(str(Path(__file__).parent.parent / "src"))
# Load environment variables
load_dotenv()
# Import the main function from etl.py
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
try:
etl_main()
return func.HttpResponse("ETL process completed successfully.",
status_code=200)
except Exception as e:
logging.error(f"ETL process failed: {str(e)}")
return func.HttpResponse(f"ETL process failed: {str(e)}",
status_code=500)
</code>
<code>from rpletl.etl import main as etl_main
import logging
import sys
from pathlib import Path
from dotenv import load_dotenv
import azure.functions as func
# Set the path to the rpletl module
sys.path.append(str(Path(__file__).parent.parent / "src"))
# Load environment variables
load_dotenv()
# Import the main function from etl.py
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
try:
etl_main()
return func.HttpResponse("ETL process completed successfully.",
status_code=200)
except Exception as e:
logging.error(f"ETL process failed: {str(e)}")
return func.HttpResponse(f"ETL process failed: {str(e)}",
status_code=500)
</code>
from rpletl.etl import main as etl_main
import logging
import sys
from pathlib import Path
from dotenv import load_dotenv
import azure.functions as func
# Set the path to the rpletl module
sys.path.append(str(Path(__file__).parent.parent / "src"))
# Load environment variables
load_dotenv()
# Import the main function from etl.py
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
try:
etl_main()
return func.HttpResponse("ETL process completed successfully.",
status_code=200)
except Exception as e:
logging.error(f"ETL process failed: {str(e)}")
return func.HttpResponse(f"ETL process failed: {str(e)}",
status_code=500)