我已经安装了hyperledger-sawtooth
。
sawtooth keygen my_key
我输入了创建密钥的命令,但是出现了这个错误:
$ sawtooth keygen my_key
Traceback (most recent call last):
File "/usr/bin/sawtooth", line 11, in <module>
load_entry_point('sawtooth-cli==1.2.4', 'console_scripts', 'sawtooth')()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2324, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3/dist-packages/sawtooth_cli/main.py", line 33, in <module>
from sawtooth_cli.batch import add_batch_parser
File "/usr/lib/python3/dist-packages/sawtooth_cli/batch.py", line 27, in <module>
from sawtooth_cli.protobuf import batch_pb2
File "/usr/lib/python3/dist-packages/sawtooth_cli/protobuf/batch_pb2.py", line 15, in <module>
from sawtooth_cli.protobuf import transaction_pb2 as sawtooth__cli_dot_protobuf_dot_transaction__pb2
File "/usr/lib/python3/dist-packages/sawtooth_cli/protobuf/transaction_pb2.py", line 22, in <module>
serialized_pb=_b('\n\'sawtooth_cli/protobuf/transaction.proto\"\xd5\x01\n\x11TransactionHeader\x12\x1a\n\x12\x62\x61tcher_public_key\x18\x01 \x01(\t\x12\x14\n\x0c\x64\x65pendencies\x18\x02 \x03(\t\x12\x13\n\x0b\x66\x61mily_name\x18\x03 \x01(\t\x12\x16\n\x0e\x66\x61mily_version\x18\x04 \x01(\t\x12\x0e\n\x06inputs\x18\x05 \x03(\t\x12\r\n\x05nonce\x18\x06 \x01(\t\x12\x0f\n\x07outputs\x18\x07 \x03(\t\x12\x16\n\x0epayload_sha512\x18\t \x01(\t\x12\x19\n\x11signer_public_key\x18\n \x01(\t\"H\n\x0bTransaction\x12\x0e\n\x06header\x18\x01 \x01(\x0c\x12\x18\n\x10header_signature\x18\x02 \x01(\t\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\"5\n\x0fTransactionList\x12\"\n\x0ctransactions\x18\x01 \x03(\x0b\x32\x0c.TransactionB*\n\x15sawtooth.sdk.protobufP\x01Z\x0ftransaction_pb2b\x06proto3')
TypeError: __new__() got an unexpected keyword argument 'serialized_options'
答案1
我只使用这两个命令
sudo apt-get update
sudo apt update
并且成功了
答案2
这个问题是由于许多 sawtooth 论坛中列出的 protobuf 过时而导致的。运行以下命令查看 protobuf 是否需要升级。
sudo apt list --upgradable
如果列出了 python3-protobuf,请运行以下命令。
sudo apt install python3-protobuf