是否可以将Anaconda软件包用作Google Cloud Functions的依赖项? [英] Is it possible to use Anaconda packages as dependencies for Google Cloud Functions?
问题描述
我正在使用Python运行时编写Google Cloud Function,并且需要包含一些pip
无法使用的依赖项.如文档此处所述,包本地依赖项,但是,在我的情况下,我想使用本地Anaconda环境的所有包,并使用该函数上传它们.有办法吗?
I am writing a Google Cloud Function using the Python Runtime and I need to include some dependencies which are not available with pip
. As described in the docs here, it should be possible to package local dependencies, however, in my case, I would like to use all the packages of a local Anaconda environment and upload them with the function. Is there a way to do so?
或者,是否可以在requirements.txt
文件中指定Anaconda软件包而不使用pip
?
Or alternatively, is there a way to specify Anaconda packages in the requirements.txt
file instead of using pip
?
推荐答案
否,不可能,Cloud Functions仅支持通过pip
从PyPI安装.
No, it's not possible, Cloud Functions only supports installing from PyPI via pip
.
您可能会对使用 Cloud Run 感兴趣,这将允许您定义自己的运行时,然后通过conda
安装Anaconda软件包.
You may be interested in using Cloud Run instead, which will allow you to define your own runtime, and thus install Anaconda packages via conda
.
这篇关于是否可以将Anaconda软件包用作Google Cloud Functions的依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!