0

Python アプリでAzure Storage Emulatorを使用しようとしていますが、次のエラーが発生します。

from azure.storage.table import TableService, Entity

#Added after error
global DEV_ACCOUNT_NAME
DEV_ACCOUNT_NAME = "devstoreaccount1"

table_service = TableService(account_name='devstoreaccount1', account_key='Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',)

table_service.use_local_storage = True
table_service.is_emulated = True

table_service.create_table("test")

エラー:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensio
ns\Microsoft\Python Tools for Visual Studio\2.0\visualstudio_py_util.py", line 7
6, in exec_file
    exec(code_obj, global_variables)
  File "c:\ScratchApp\ScratchApp.py", line 17, in <module>
    table_service.create_table("test")
  File "C:\Python27\lib\site-packages\azure\storage\table\tableservice.py", line
 274, in create_table
    request, self.use_local_storage)
  File "C:\Python27\lib\site-packages\azure\storage\_common_serialization.py", l
ine 212, in _update_request_uri_query_local_storage
    return '/' + DEV_ACCOUNT_NAME + uri, query
NameError: global name 'DEV_ACCOUNT_NAME' is not defined
Press any key to continue . . .

何か案は?

4

1 に答える 1

1

あるモジュールで変数をグローバルとして宣言しても、魔法のように他のモジュールから見えるようになるわけではありません。

ただし、特定の問題に対処するために、これはしばらく前に修正された既知の問題のようです。Azure ストレージ モジュールの最新バージョンはありますか?

于 2016-05-27T22:26:24.093 に答える