Python 使用europe-west1时谷歌云功能部署错误

Python 使用europe-west1时谷歌云功能部署错误,python,deployment,google-cloud-functions,region,Python,Deployment,Google Cloud Functions,Region,我正在使用云函数部署python函数(版本=3.7,内存=1go,超时=1s) 到目前为止,它工作得很好 但是,我注意到,默认情况下,云函数的区域设置为us-central1。 我需要我的函数位于europe-west1中,因此我使用 gcloud函数部署--欧洲西部地区1 ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Function failed on loading user code. Error mes

我正在使用云函数部署python函数(版本=3.7,内存=1go,超时=1s)

到目前为止,它工作得很好

但是,我注意到,默认情况下,云函数的区域设置为
us-central1
。 我需要我的函数位于
europe-west1
中,因此我使用

gcloud函数部署--欧洲西部地区1

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Function failed on loading user code. Error message: Error: function load attempt timed out
我不明白为什么它只适用于美国中部而不适用于欧洲西部

有什么想法吗

谢谢你的帮助

编辑

Thx雷诺和巴勃罗

我的信息中有拼写错误,但我想我得到了正确的命令。这是:

gcloud functions deploy my_test --entry-point my_test_1 --runtime python37 --memory 1024MB --region=europe-west1 --trigger-http
我仍然收到同样的错误信息

但是这个

gcloud functions deploy my_test --entry-point my_test_1 --runtime python37 --memory 1024MB --trigger-http
很好


希望有人有想法:)谢谢

根据您的更新(以及巴勃罗·阿尔梅西亚·罗德里格斯的回答)进行更新:

您必须遵循此操作(即“部署命令的完整参考”)并在需要时添加
=
,如文档中所述:

所以你应该:

gcloud functions deploy my_test --entry-point=my_test_1 --runtime=python37 --memory=1024MB --timeout=1s --region=europe-west1 --trigger-http

您有几个输入错误(如果是第一次部署云函数,则缺少两个参数)。您的命令应如下所示:

gcloud functions deploy ... --region=europe-west1 [--trigger-http --runtime=python37]
               ^                    ^
最后一个参数是触发器和运行时的示例(在本例中,您使用的是相同的参数),因为如果是第一次部署函数,则需要指定所需的触发器,理想情况下还需要指定运行时


正如Renaud所提到的,这里是关于部署云功能的参数的详细信息。

请参阅我答案的更新:您必须遵循我在答案中提到的文档,并在需要时添加
=
,如文档中所述。
gcloud functions deploy ... --region=europe-west1 [--trigger-http --runtime=python37]
               ^                    ^