I’m tring to create a wallet on my node that is catching up with the TestNet. There are no wallets yet, so I want to create the very first one using Python SDK.
Traceback (most recent call last):
File "/home/pi/Algorand_Python/wallet_create_example.py", line 10, in <module>
wallet = Wallet("test_cusma", "test_cusma", kcl)
File "/home/pi/.local/lib/python3.7/site-packages/algosdk/wallet.py", line 33, in __init__
wallets = self.kcl.list_wallets()
File "/home/pi/.local/lib/python3.7/site-packages/algosdk/kmd.py", line 87, in list_wallets
return self.kmd_request("GET", req)["wallets"]
KeyError: 'wallets'
Inspecting the errors I fund that this Wallet’s method is failing:
def list_wallets(self):
"""
List all wallets hosted on node.
Returns:
dict[]: list of dictionaries containing wallet information
"""
req = "/wallets"
return self.kmd_request("GET", req)["wallets"]
I tried directly with the API and it seems working:
You need to make sure the KMD process has started first before making the call in the Python, there is a little section up above the code section that talks about this - Creation methods - Algorand Developer Portal.
Try auto-starting KMD with goal and re-run. If it still fails, post the error here.