ebellocchia / bip_utils

Generation of mnemonics, seeds, private/public keys and addresses for different types of cryptocurrencies
MIT License
292 stars 83 forks source link

ImportError: cannot import 'Bip32' from 'bip_utils' #101

Closed alexh0000 closed 1 year ago

alexh0000 commented 1 year ago

Hello,

I am confused on the syntax here for bip_utils. I've had this code working before, but I pulled my repo to a new folder and now cannot get past this error. The prior fix was installing bip_utils, however, this doesn't seem to work anymore.

import hashlib from bip_utils import Bip32 <------- from bip_utils.bip.bip_keys import BipPublicKey from bip_utils.conf.bip44_coins import Bip44Coin from bip_utils.conf.bip_coin_conf import Bip32Conf from bip_utils.conf.bip_coin_conf_helper import * from bip_utils.addr import P2PKH

Traceback: command ran: python3 -m src.backend.server Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/ah/Documents/WC_2/ifd/src/backend/server.py", line 814, in from src.backend.avalanche_adapter import ( File "/Users/ah/Documents/WC_2/ifd/src/backend/adapter.py", line 323, in from src.backend.addresses import AddressGenerator File "/Users/ahanvey/Documents/WC_2/ifd/src/backend/addresses.py", line 186, in from bip_utils import Bip32 ImportError: cannot import name 'Bip32' from 'bip_utils' (/Users/ah/Library/Python/3.9/lib/python/site-packages/bip_utils/init.py)

OS: Mac OSX Ventura VS code IDE

ebellocchia commented 1 year ago

Hi, The Bip32 class does not exist anymore, your code is based on an old library version. You should update the code using the new classes.

Regards, Emanuele