简体   繁体   English

“从扩展导入实用程序”在 AWS Glue Jupyter Notebook 中给出错误

[英]'from extension import utils' giving error in AWS Glue Jupyter Notebook

In AWS Glue Jupyter Notebook, When I run the command from extension import utils i get error ModuleNotFoundError: No module named 'extension'在 AWS Glue Jupyter Notebook 中,当我from extension import utils实用程序运行命令时,我收到错误ModuleNotFoundError: No module named 'extension'

Below is the complete list of things that I have to import, Only the last one I am getting error.下面是我必须导入的东西的完整列表,只有最后一个我得到了错误。

import time
import boto3
import logging 

from datetime import timedelta, datetime
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from awsglue.context import GlueContext
from awsglue.job import Job
from pyspark.context import SparkContext
from pyspark.sql.types import *

import pyarrow as pa
import numpy as np
import pandas as pd

from extension import utils

Screenshot:截屏: 在此处输入图像描述

I tried pip install extension but don't know whats going on.我试过pip install extension ,但不知道发生了什么。 在此处输入图像描述

It seems that you have not installed extension module.看来您还没有安装extension模块。

You can add install the module by adding the following in the previous cell.您可以通过在上一个单元格中添加以下内容来添加安装模块。

!pip3 install extension

First of all, in order to add additional libraries you can use %additional_python_modules option in notebook.首先,为了添加额外的库,你可以在 notebook 中使用%additional_python_modules选项。 You can give pypi packages or s3 location of packages.您可以提供 pypi 包或包的 s3 位置。

Second, I dont see utils class in any of extension/extensions/pyextension packages.其次,我在任何扩展/扩展/pyextension 包中都没有看到 utils class。 Can you double check the package.?你能仔细检查一下 package 吗? If its internal package, i suggest using s3 option.如果它的内部 package,我建议使用 s3 选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM