Google Cloud Function - Function load error: File main.py that is expected to define function doesn't exist

前端 未结 5 1197
渐次进展
渐次进展 2021-01-04 16:36

I am trying to implement a Google Cloud function that is based on code in a Git style repository. I have the code linked to Google Cloud Platform\'s \"Source Repositories\"

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-04 17:04

    If you're trying to upload your code zip using a GCS bucket or the file upload function, make sure that you don't zip the folder that contains your code but just the code files.

    CodeFolder
    ├── package
    |   ├──script1.py
    |   └──script2.py
    ├── package2
    ├── ...
    ├── main.py
    └── requirements.txt
    

    Do NOT create a Zip file from the CodeFolder.

    Instead, create a zip file from main.py and requirement.txt and package.

    Source

提交回复
热议问题