首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Azure函数应用程序:已安装依赖项,但找不到某些依赖项

问Azure函数应用程序:已安装依赖项,但找不到某些依赖项
EN

Stack Overflow用户
提问于 2020-10-16 19:56:17
回答 1查看 47关注 0票数 0

我正在使用Dockerfile和requirements.txt来设置我的azure函数应用程序(遵循this教程)。这是我的Dockerfile这是我的requirements.txt在我使用sudo docker build --tag measurekid/mkserverless:v1.0.0 .构建docker镜像之后,我运行sudo docker run -p 8080:80 -it measurekid/mkserverless:v1.0.0并获得this error。项目结构如下:

代码语言:javascript
复制
|-- project 
   |-- serverless #(which is the azure function root)
      |-- BedPredict 
         |-- __init__.py and more
   |-- bed-coordinates-detection
      |-- bed_pipeline.py (which has the function "mask_pipeline")

在我的__init__.py文件中,我有以下几行:

代码语言:javascript
复制
import sys
sys.path.append("../../bed-coordinates-detection/")
from bed_pipeline import mask_pipeline

但是正如你在上面附加的错误消息中看到的,我得到了ModuleNotFoundError: No module named 'bed_pipeline'。

我尝试使用this troubleshooting guide,但我无法访问项目文件(所有方法都不起作用)。

我是Azure和Azure函数应用的新手,我不知道哪里出了问题。有什么想法吗?任何回应都将不胜感激。

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2020-10-17 00:40:19

根据您的项目结构,您需要从__init__.py更上一层楼才能获得bed-coordinates-detection。在您的项目结构中,名称也是bed-bed-coordinates-detection (床两次,是不是打错了?)。

代码语言:javascript
复制
import sys
sys.path.append("../../bed-coordinates-detection/")
from bed_pipeline import mask_pipeline

顺便说一下,这个问题与Azure函数或Docker无关。您可以在本地进行调试,而无需停靠,这很容易揭示问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64388741

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档