小编swy*_*rts的帖子

AttributeError:模块“google.cloud”没有属性“存储”

我正在尝试在 GCP Dataflow 上运行一个简单的 Beam 脚本,以便将 scikit-learn 模型应用于某些数据。应用模型之前和之后都需要对数据进行处理。这就是textExtraction 和translationDictionary 的作用。我不断收到错误AttributeError: module 'google.cloud' has no attribute 'storage'(下面是完整的堆栈跟踪)。正如您所看到的,我尝试在新的虚拟环境中运行新的安装。知道如何修复吗?

我的脚本也在下面给出。

预测_DF_class.py

import apache_beam as beam
import argparse
from google.cloud import storage
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import SetupOptions
from apache_beam.io.gcp.bigquery import parse_table_schema_from_json
import pandas as pd
import pickle as pkl
import json
import joblib

query = """
    SELECT index, product_title
    FROM `project.dataset.table`
    LIMIT 1000
"""

class ApplyDoFn(beam.DoFn):
    def __init__(self):
        self._model = None
        self._textExtraction = None
        self._translationDictionary = None
        self._storage = …
Run Code Online (Sandbox Code Playgroud)

python google-cloud-dataflow apache-beam

0
推荐指数
1
解决办法
2094
查看次数