2

I am not able to use google-cloud-storage in my Airflow.
I am using cloud composer for my Airflow environment.

Dag is not accepting it when I am using the below statement in my .py code

from google.cloud import storage 

Its giving me an error saying that invalid character in identifier (MyPythonCode.py, line 6(where I am using that statement)

I have installed the required pypi package (google-cloud-storage) in my cloud composer PYPI Packages.

Whenever I am commenting that line, my DAG accepts .py file.
I have seen the same issue raised by other person Here, but when he added the required package, it started working. But not in my case.

Ashish Kumar
  • 542
  • 4
  • 20
  • Did you install it using the instructions in https://cloud.google.com/composer/docs/how-to/using/installing-python-dependencies ?? – kaxil Nov 25 '18 at 19:47
  • It is possible you have invalid whitespace on that line. Hard to tell without seeing more. What version of Cloud Composer, Airflow, and Python? – Tim Swast Nov 26 '18 at 23:59
  • Did you copy paste the line? Take a look at this [answer](https://stackoverflow.com/a/14844830/435089) and see if it helps – Kannappan Sirchabesan Jan 19 '19 at 12:23

0 Answers0