Python模块'modules'没有属性'millis'

时间:2019-04-25 16:30:12

标签: python python-3.x

对于Python来说是完全陌生的,我已经安装了最新的库存版本,更新了PIP并试图运行一个脚本,以便从API导入数据(提供的人说的对他们有用),当试图运行时,我已经安装了每个库必填。

 import json
 import pandas as pd
 from pandas.io.json import json_normalize
 import requests
 import modules
 from requests_oauthlib import OAuth1
 from datetime import datetime

这是主标题,我现在收到错误AttributeError:模块'modules'在下一行没有属性'millis'

 payload = {'interactive': 'true',
       "ended": 'true',
       "start": {"from": modules.millis(2019,4,21,0,0),   # CHANGE HERE THE DATE
                 "to": modules.millis(2019,4,24,23,59)},  # CHANGE HERE THE DATA
       'skillIds':['1286977632']
        } 

任何想法。

1 个答案:

答案 0 :(得分:0)

抱歉,我找到了此修复程序,它在当时没有提供的单独文件中

@app.on_s3_event(bucket=s.BUCKET_NAME, events=['s3:ObjectCreated:*'], prefix=s.PREFIX_PREPROCESSED, suffix=s.SUFFIX)
def handle_pre_processed_event(event):
    """
    Lambda for preprocessed data

    :param event:
    :return:
    """
    # Retrieve the json that was add to the bucket S3
    json_s3 = get_json_file_s3(event.bucket, event.key)
    # Send all the records to dynamoDB
    insert_records(json_s3)
    # Change the path of the file by copying it and delete it
    change_path_file(event.key, s.PREFIX_PREPROCESSED)