IBM云函数“无效的virtualenv.Zip文件不包括activate\u this.py”

2024-06-02 19:34:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我想将一个带有虚拟环境的python脚本(我需要一个不在IBM云函数提供的运行时中的库)部署到IBM云函数。我想用简单的拉链来做,所以 我遵循文档:将Python代码与本地虚拟环境打包在压缩文件中,链接如下: https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prep

我已经安装了Python3.7,virtualenv也使用了它。virtualenv根据需要命名为“virtualenv”,但我在尝试调用操作时仍会收到错误: 结果:

{
  "error": "The action failed to generate or locate a binary. See logs for details."
}
Logs:
[
  "2021-05-20T09:27:03.627094Z    stderr: Invalid virtualenv. Zip file does not include activate_this.py",
  "2021-05-20T09:27:03.627Z       stderr: The action did not initialize or run as expected. Log data might be missing."
]

我检查了virtualenv目录,在Scripts文件夹中有“activate_this.py”

我错过了什么?我采取的步骤和文档之间的唯一区别是我有一台windows计算机,因此环境的激活类似于virtualenv\Scripts\activate,而不是通过bin,我通过windows GUI压缩了脚本和virtualenv

云函数是否可能尝试在“bin”文件夹而不是“Scripts”文件夹中查找文件?如果是,我能做什么

谢谢


Tags: orthe函数文档脚本文件夹virtualenvstderr