0

This is my first time using BigQuery (I'm using Python 3.7 on Windows 10), and I found a helpful thread here and the BigQuery quickstart guide, BUT when I run

os.environ["GOOGLE_APPLICATION_CREDENTIALS] = "PATH\TO\file_name.json"

I get the error:

  File "<ipython-input-14-ee09f24087ab>", line 1
    os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "C:\Users\Jack\Downloads\StackOverflow-80e374bb80fd.json"
                                                  ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

I followed the instructions for getting that file, named myself owner, and did not alter the .json file. Is there a way to change the encoding? I can't find anything about encoding in the docs. Any help would be appreciated, thanks in advance.

1 Answer 1

1

You need to escape your slashes or it will be read as in invalid unicode character:

"C:\\Users\\Jack\\Downloads\\StackOverflow-80e374bb80fd.json"
Sign up to request clarification or add additional context in comments.

2 Comments

Of course, I didn't even think of that... Thank you!
No problem. Windows will get you every time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.