Google Cloud Storage의 버킷에 파일을 업로드하는 방법을 배우려고합니다. 는이 코드를 발견 https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/storage/cloud-client 이 내가 코드를 실행할 수 없습니다 오전, 운영의 무리가 만든 버킷을 좋아합니까 삭제 - 버킷리스트 ...python snippets.py를 사용하여 Google Cloud Storage의 버킷에 파일을 업로드하는 방법은 무엇인가요?
을 업로드 및 다운로드 그러나 수 있습니다.
내가 시도 :
python snippets.py [-h] scene.appspot.com list
오류 :
error: argument command: invalid choice: 'scene-maker.appspot.com' (choose from 'create-bucket', 'delete-bucket', 'get-bucket-labels', 'add-bucket-label', 'remove-bucket-label', 'list', 'list-with-prefix', 'upload', 'download', 'delete', 'metadata', 'make-public', 'signed-url', 'rename', 'copy')
내가 시도 :
python snippets.py [-h] list scene.appspot.com
python snippets.py [-h] list gs://scene.appspot.com
python snippets.py [-h] list "gs://scene.appspot.com"
python snippets.py [-h] list bucket_name
오류 :
error: unrecognized arguments: scene.appspot.com
error: unrecognized arguments: gs://scene.appspot.com
내가 시도 :
python snippets.py list [-h] scene.appspot.com
오류 :
error: argument command: invalid choice: '[-h]' (choose from 'create-bucket', 'delete-bucket', 'get-bucket-labels', 'add-bucket-label', 'remove-bucket-label', 'list', 'list-with-prefix', 'upload', 'download', 'delete', 'metadata', 'make-public', 'signed-url', 'rename', 'copy')
내가 시도 :
python snippets.py [-h] list
오류 :
Traceback (most recent call last):
File "snippets.py", line 322, in <module>
list_blobs(args.bucket_name)
File "snippets.py", line 88, in list_blobs
bucket = storage_client.get_bucket(bucket_name)
File "C:\Anaconda2\lib\site-packages\google\cloud\storage\client.py", line 172, in get_bucket
bucket = Bucket(self, name=bucket_name)
File "C:\Anaconda2\lib\site-packages\google\cloud\storage\bucket.py", line 113, in __init__
name = _validate_name(name)
File "C:\Anaconda2\lib\site-packages\google\cloud\storage\_helpers.py", line 39, in _validate_name
'Bucket names must start and end with a number or letter.')
ValueError: Bucket names must start and end with a number or letter.
나는 실행하면 : gsutil ls
내가 얻을 :
gs://scene.appspot.com/
gs://staging.scene.appspot.com/
어떻게 python snippets.py
명령을 사용할 수 있나요? 궁극적으로 사용자가 웹 브라우저에서 Cloud Storage로 파일을 업로드 할 수 있기를 바랍니다.
작동합니다! 그런 세부적인 설명에 감사드립니다. – Beginner