Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Web3' object has no attribute 'isConnected'

I am trying to connect to the Ethereum blockchain with Web3. When I install web3 using jupyter notebook I keep receiving the error that Web3 has no attribute. Can someone please advise on how to get connected to the Ethereum network?

MY CODE:

pip install web3

from web3 import Web3, EthereumTesterProvider
w3 = Web3(EthereumTesterProvider())
w3.isConnected() 

ERROR:

AttributeError Traceback (most recent call last)
Input In [29], in <cell line: 3>()
  1 from web3 import EthereumTesterProvider
  2 w3 = Web3(EthereumTesterProvider())
----> 3 w3.isConnected()

AttributeError: 'Web3' object has no attribute 'isConnected'

I have tried both web3 and capital Web3 and still receive the same error. I have also tried

w3 = Web3(Web3.EthereumTesterProvider()) 

but same issues.

like image 455
newbiezz Avatar asked Sep 18 '25 20:09

newbiezz


1 Answers

Please try is_connected() instead of isConnected().

like image 79
starmori Avatar answered Sep 21 '25 11:09

starmori