Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在requirements.txt中为Google云函数导入speech_v1_Python_Google Cloud Platform_Google Cloud Functions - Fatal编程技术网

Python 如何在requirements.txt中为Google云函数导入speech_v1

Python 如何在requirements.txt中为Google云函数导入speech_v1,python,google-cloud-platform,google-cloud-functions,Python,Google Cloud Platform,Google Cloud Functions,我基本上是将其用作Google Cloud函数的Python代码: 我无法在requirements.txt文件中正确导入speech\u v1库 我得到了这个错误: Build失败:{“error”:{“canonicalCode”:“INVALID_ARGUMENT”,“errorMessage”:“pip_download_wheels有stderr输出:\n错误:找不到满足要求的版本google-cloud-speech-v1==1.3.2(来自-r requirements.txt(

我基本上是将其用作Google Cloud函数的Python代码:

我无法在
requirements.txt
文件中正确导入
speech\u v1

我得到了这个错误:

Build失败:{“error”:{“canonicalCode”:“INVALID_ARGUMENT”,“errorMessage”:“pip_download_wheels有stderr输出:\n错误:找不到满足要求的版本google-cloud-speech-v1==1.3.2(来自-r requirements.txt(第3行))(来自版本:无)\错误:找不到与google-cloud-speech-v1==1.3.2(来自-r requirements.txt(第3行))\n\n错误:
pip\u下载\u车轮
返回的代码:1”,“errorType:“InternalError”,“errorId:”}


尝试在您的需求中使用
googlecloudspeech==1.3.2

在您的
requirements.txt
中,您应该指定:

google-cloud-speech==1.3.2
其中名称和版本与PyPI上的此版本相对应:

这允许您执行以下任一操作:

from google.cloud import speech
from google.cloud import speech_v1

其中,
speech
始终是最新版本,
speech\u v1
确保您始终使用API的v1。

在requirements.txt中指定
google cloud speech
。这仍然会给我错误,因为speech\u v1未定义。显示生成错误的代码。你猜语音v1是未定义的吗?