2017-05-09 2 views
1

) 이것은 내 첫 번째 질문이며 일부 답변을 찾기 전에 정말 힘든 시간을 보냈습니다. 아주 간단한 파이프 라인을 만들고 싶으시고 처음에 이미 붙어 있습니다.빔 데이터 흐름 파이썬 이름 'PipelineOptions'이 정의되지 않았습니다.

import apache_beam as beam 
options = PipelineOptions() 
google_cloud_options = options.view_as(GoogleCloudOptions) 
google_cloud_options.project = 'myproject' 
google_cloud_options.job_name = 'mypipe' 
google_cloud_options.staging_location = 'gs://mybucket/staging' 
google_cloud_options.temp_location = 'gs://mybucket/temp' 
options.view_as(StandardOptions).runner = 'DataflowRunner' 

는 오류 발생 : 여기 내 코드는 오는 나가서 설명하자면 NameError : 이름이 'PipelineOptions은'당신의 도움을

들으을 정의되어 있지 않습니다.

답변

0

예제가 작동하려면 당신은 몇 가지 추가 수입을 추가해야합니다

from apache_beam.io import ReadFromText 
from apache_beam.io import WriteToText 
from apache_beam.metrics import Metrics 
from apache_beam.utils.pipeline_options import PipelineOptions 
from apache_beam.utils.pipeline_options import SetupOptions 
from apache_beam.utils.pipeline_options import GoogleCloudOptions 
from apache_beam.utils.pipeline_options import StandardOptions 
관련 문제