Search code examples
pythonapiweb3pygo-ethereum

AttributeError: module 'web3.geth' has no attribute 'admin'


I am following the geth api documentation (https://web3py.readthedocs.io/en/v5/web3.geth.html#gethadmin-api) and when running web3.geth.admin.start_ws(host='localhost', port=8546, cors="", apis="eth, net, web3") getting the following error AttributeError: module 'web3.geth' has no attribute 'admin'


Solution

  • I used:

    from web3 import Web3, HTTPProvider

    w3 = Web3(HTTPProvider('http://localhost:8545'))

    to connect to the local geth node and it is working fine.