1

I am working on a smart contract integrated Django project. But When I try to check the account using Web3.eth.accounts get an error,

AttributeError: type object 'Web3' has no attribute 'eth'

Other coding part given below,

from web3 import Web3
import time
import sys
from .auth_contract_connection import contract_address,abi
sys.path.append('../')
from connection import connection

con=Web3(Web3.HTTPProvider("HTTP://127.0.0.1:7545"))

how I slow this?

1 Answer 1

1

You need to call what was initialised as Web3. in your case, con

con.eth.accounts

alternatively use the standard web3 or w3

web3 = Web3(Web3.HTTPProvider("HTTP://127.0.0.1:7545"))

then your code will work with web.eth.accounts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.