karask/python-bitcoin-utils

TypeError: 'type' object is not subscriptable

Closed this issue · 1 comments

I tried to run this code :
https://github.com/karask/python-bitcoin-utils/blob/master/examples/spend_p2tr_default_path.py
I got tihs TypeError :
Traceback (most recent call last):
File "bitcoin.py", line 14, in
from bitcoinutils.transactions import Transaction, TxInput, TxOutput, TxWitnessInput
File "/home/mhshoara/.local/lib/python3.8/site-packages/bitcoinutils/transactions.py", line 35, in
from bitcoinutils.script import Script
File "/home/mhshoara/.local/lib/python3.8/site-packages/bitcoinutils/script.py", line 233, in
class Script:
File "/home/mhshoara/.local/lib/python3.8/site-packages/bitcoinutils/script.py", line 272, in Script
def init(self, script: list[Any]):
TypeError: 'type' object is not subscriptable

How can I solve this problem ?

Hi @mhshoara,

You need python 3.10 and above for the typing to work. I updated the readme accordingly. Thanks for the feedback.