0

我想为 NFT 元数据运行以下脚本。

“https://github.com/ProjectOpenSea/metadata-api-python”

每当我运行脚本时,我都会收到以下错误消息:

python3 app.py
 * Serving Flask app 'app' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 106-248-837
127.0.0.1 - - [10/Sep/2021 18:11:05] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [10/Sep/2021 18:11:09] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [10/Sep/2021 18:11:10] "GET /creature/2 HTTP/1.1" 404 -
127.0.0.1 - - [10/Sep/2021 18:11:11] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [10/Sep/2021 18:11:11] "GET /api/creature/2 HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/Kehrenkamp/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 2088, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/Kehrenkamp/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/Kehrenkamp/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/Kehrenkamp/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/Kehrenkamp/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/Kehrenkamp/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/Users/Kehrenkamp/Desktop/opensea-creatures-master/metadata-api/app.py", line 112, in creature
    image_url = _compose_image(['images/bases/base-%s.png' % base,
  File "/Users/Kehrenkamp/Desktop/opensea-creatures-master/metadata-api/app.py", line 311, in _compose_image
    blob = _get_bucket().blob(f'{path}/{token_id}.png')
  File "/Users/Kehrenkamp/Desktop/opensea-creatures-master/metadata-api/app.py", line 327, in _get_bucket
    return client.get_bucket(GOOGLE_STORAGE_BUCKET)
  File "/Users/Kehrenkamp/Library/Python/3.8/lib/python/site-packages/google/cloud/storage/client.py", line 762, in get_bucket
    bucket = self._bucket_arg_to_bucket(bucket_or_name)
  File "/Users/Kehrenkamp/Library/Python/3.8/lib/python/site-packages/google/cloud/storage/client.py", line 241, in _bucket_arg_to_bucket
    bucket = Bucket(self, name=bucket_or_name)
  File "/Users/Kehrenkamp/Library/Python/3.8/lib/python/site-packages/google/cloud/storage/bucket.py", line 611, in __init__
    name = _validate_name(name)
  File "/Users/Kehrenkamp/Library/Python/3.8/lib/python/site-packages/google/cloud/storage/_helpers.py", line 81, in _validate_name
    raise ValueError("Bucket names must start and end with a number or letter.")
ValueError: Bucket names must start and end with a number or letter.
127.0.0.1 - - [10/Sep/2021 18:11:11] "GET /api/creature/2?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [10/Sep/2021 18:11:11] "GET /api/creature/2?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [10/Sep/2021 18:11:11] "GET /api/creature/2?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [10/Sep/2021 18:11:11] "GET /api/creature/2?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -

我的问题是如何正确配置我的 Google 存储帐户以使其正常工作?

每次我再次收到错误时: ValueError("Bucket names must start and end with a number or letter.")

我的桶名是:“kehrenkamp”他以字母开头并以字母结尾?!?

有人可以帮我吗

提前致谢。

问候克伦坎普

4

0 回答 0