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

Question:

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'

Asked By: Bemz

||

Answers:

I used:

from web3 import Web3, HTTPProvider

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

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

Answered By: Bemz
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.