2

Using Ubuntu 14.04, DataFlow Python SDK

Following instructions at [https://github.com/GoogleCloudPlatform/DataflowPythonSDK#status-of-this- release] , after everything is loaded when I try the wordcount example I try get the error "Import by filename is not supported".

I suspect the issue is at line 23 of the wordcount.py example

import google.cloud.dataflow as df

Is there a workaround for this issue?

I have tried the solution posted at Python / ImportError: Import by filename is not supported , but that does not solve the problem.

Thom Rogers
  • 1,385
  • 2
  • 20
  • 33

1 Answers1

3

Since this fails at the first import statement the immediate thing to check is if the Python Dataflow package is installed at all. Th way to do that is by running 'pip freeze'. Here is some output from running this in a virtual environment:

$ pip freeze ... Nothing since it is a clean virtual environment ...

$ pip install https://github.com/GoogleCloudPlatform/DataflowPythonSDK/archive/v0.2.3.tar.gz ... Output from installing packages ...

$ pip freeze ... python-dataflow==0.2.3 ...

Now you can run python and execute 'import google.cloud.dataflow as df' and it should work. Hopefully this helps!

Silviu
  • 231
  • 1
  • 6
  • Thanks Silviu. It turns out I was installing the Python Dataflow package as sudo and trying to use it as a local user. Full details at https://github.com/GoogleCloudPlatform/DataflowPythonSDK/issues/11 Many thanks!!! – Thom Rogers Apr 29 '16 at 21:55