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
GCP-云功能can';在同一项目中,无法从工件注册表中找到Python包_Python_Google Cloud Platform_Google Cloud Functions_Google Artifact Registry - Fatal编程技术网

GCP-云功能can';在同一项目中,无法从工件注册表中找到Python包

GCP-云功能can';在同一项目中,无法从工件注册表中找到Python包,python,google-cloud-platform,google-cloud-functions,google-artifact-registry,Python,Google Cloud Platform,Google Cloud Functions,Google Artifact Registry,我一直在尝试GCP的工件注册表,它目前是alpha for Python包 我通过密钥环和我的服务帐户进行身份验证,如中所述 通过安装以下requirements.txt,我可以使用Twine成功上传一个包,并将其成功下载到本地Python项目中: --extra-index-url https://my-region-pypi.pkg.dev/my-project/my-python-repo/simple/ my-package --extra-index-url https://my-r

我一直在尝试GCP的工件注册表,它目前是alpha for Python包

我通过密钥环和我的服务帐户进行身份验证,如中所述

通过安装以下
requirements.txt
,我可以使用Twine成功上传一个包,并将其成功下载到本地Python项目中:

--extra-index-url https://my-region-pypi.pkg.dev/my-project/my-python-repo/simple/
my-package
--extra-index-url https://my-region-pypi.pkg.dev/my-project/my-python-repo/simple/
keyring
keyrings.google-artifactregistry-auth
my-module
但是,当我使用上面显示的相同的
requirements.txt
将最小的云函数部署到与我的工件注册表相同的项目时,部署失败,输出如下:

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: `pip_download_wheels` had stderr output:
ERROR: Could not find a version that satisfies the requirement my-package (from -r requirements.txt (line 2)) (from versions: none)
ERROR: No matching distribution found for my-package (from -r requirements.txt (line 2))
我试过使用
--额外的索引url
和普通的
--索引url
,没有区别。我还尝试使用以下
requirements.txt
安装keyring依赖项:

--extra-index-url https://my-region-pypi.pkg.dev/my-project/my-python-repo/simple/
my-package
--extra-index-url https://my-region-pypi.pkg.dev/my-project/my-python-repo/simple/
keyring
keyrings.google-artifactregistry-auth
my-module
但我也犯了同样的错误

我检查了我的项目的默认应用程序引擎服务帐户的权限,该帐户也用于云功能,我可以确认它具有工件注册表读取器角色,因此似乎没有权限问题

我还尝试部署一个最小的应用引擎服务,而不是一个云功能,但我得到了相同的错误

非常感谢你的帮助