No module named options.pipeline_options

I just started with the original Apache documentation guide, it looks like this particular pipeline import is no longer available.

from apache_beam.options.pipeline_options import PipelineOptions

Link: https://beam.apache.org/documentation/programming-guide/#pipeline

Mistake:


ImportError Traceback (last call last) in () ----> 1 from apache_beam.options.pipeline_options import PipelineOptions

**

ImportError: No module named options.pipeline_options

**

Any active python users of the apache bundle? Who knows what is the actual import path?

+3


source to share


2 answers


It looks like it has been renamed / refactored to this module name:

from apache_beam.pipeline import PipelineOptions

Basically its apache_beam.pipeline instead of apache_beam.options.pipeline_options



And it works successfully!

Note: 2.7.13 is my python version

+2


source


Go to Python Lib folder or site folder and check the folder structure in the apache_beam package.

If the structure is a folder apache_beam\pipeline

then your import statement should befrom apache_beam.pipeline import *



Or is it better to use a target import operation as pointed out in @gnanagurus answer.

+2


source







All Articles