Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gsutil file download OSError: Permission denied. KiB

I am trying to download some samples from Google storage to do a sentiment analysis. I am following the instructions but get an error (I actually added a destination file to their instruction and the error is different):

Error as defined by Google on example: Jorge:python3.7 jbp$ gsutil cp gs://cloud-samples-tests/natural-language/sentiment-samples.tgz CommandException: Wrong number of arguments for "cp" command. Traceback (most recent call last): File "", line 1, in File "/Users/jbp/Python/env/lib/python3.7/google-cloud-sdk/platform/gsutil/gslib/init.py", line 29, in import tempfile File "tempfile.py", line 39, in import functools as _functools File "functools.py", line 8 SyntaxError: Non-ASCII character '\xc5' in file functools.py on line 8, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details Jorges-MBP:python3.7 jbarrigapartarrieu$

Error with destination file: Jorge:python3.7 jbp$ gsutil cp gs://cloud-samples-tests/natural-language/sentiment-samples.tgz /User/jbp/Python Copying gs://cloud-samples-tests/natural-language/sentiment-samples.tgz... OSError: Permission denied. KiB]
Traceback (most recent call last): File "", line 1, in File "/Users/jbarrigapartarrieu/Python/env/lib/python3.7/google-cloud-sdk/platform/gsutil/gslib/init.py", line 29, in import tempfile File "tempfile.py", line 39, in import functools as _functools File "functools.py", line 8 SyntaxError: Non-ASCII character '\xc5' in file functools.py on line 8, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

like image 610
jbarriga Avatar asked Oct 19 '25 01:10

jbarriga


1 Answers

Adding sudo to the line solved my problem

sudo gsutil cp gs://cloud-samples-tests/natural-language/sentiment-samples.tgz ./
like image 138
user13750030 Avatar answered Oct 22 '25 05:10

user13750030



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!