Jeffrey Van Laethem
Jeffrey Van Laethem

Reputation: 2651

Functions Framework giving "Provided code is not a loadable module. Could not load the function, shutting down."

I have a Google Cloud Function I've developed. The main.py and requirements.txt file are both in a folder called "hello". Here's the entirety of my main.py file:

import functions_framework
import logging

logging.basicConfig(level=logging.INFO)

@functions_framework.http
def hello(request):
    logging.info('Hello request received')
    return "ok"

When I open a terminal at the hello folder and use the command

functions-framework --target=hello

I receive

Provided code is not a loadable module. Could not load the function, shutting down.

as output. I've reinstalled functions framework, restarted my console, and cannot understand why I'm getting this error since hello is definitely a function name.

Upvotes: 1

Views: 1199

Answers (0)

Related Questions