Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/349.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
在Azure函数中使用python的Gremlin操作_Python_Azure_Graph_Gremlin_Azure Cosmosdb Gremlinapi - Fatal编程技术网

在Azure函数中使用python的Gremlin操作

在Azure函数中使用python的Gremlin操作,python,azure,graph,gremlin,azure-cosmosdb-gremlinapi,Python,Azure,Graph,Gremlin,Azure Cosmosdb Gremlinapi,Is试图使用Python(Http触发器)创建Azure函数,以从gremlin图中获取数据。 我曾经 从gremlin_python.driver将客户端作为clientDriver导入 导入库,并且在本地运行良好 当我将相同的代码部署到Azure门户并运行代码时,我收到了500个内部错误。 在尝试了一些更改之后,我可以看到“from gremlin_python.driver import client as clientDriver”import语句不起作用(当我删除这段代码时,代码就起作

Is试图使用Python(Http触发器)创建Azure函数,以从gremlin图中获取数据。 我曾经 从gremlin_python.driver将客户端作为clientDriver导入 导入库,并且在本地运行良好

当我将相同的代码部署到Azure门户并运行代码时,我收到了500个内部错误。 在尝试了一些更改之后,我可以看到“from gremlin_python.driver import client as clientDriver”import语句不起作用(当我删除这段代码时,代码就起作用了)

当我们在VSCode中运行代码时,我们正在创建一个虚拟env并安装gremlin包,因此它在本地工作,而不是在Azure门户中


有人能帮我解决这个问题吗。

对于这个问题,我们需要确保
requirements.txt
是正确的。如果你只是按行导入模块

from gremlin_python.driver import client as clientDriver
您需要添加另一行来显式导入
gremlin\u python.driver
模块

import gremlin_python.driver

希望有帮助~

嗨,Gokul,我可以知道这个解决方案是否有效吗?谢谢你的回复。我试过了,正如文章中提到的,我也会试一下你的