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.
pip is installing bip_utils properly (pip3 install bip-utils)
current working directory is correct
version of bip_utils version: 2.7.0
Import statements causing issues:
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)
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