3

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.

TylerH
  • 20,799
  • 66
  • 75
  • 101
newbiezz
  • 31
  • 2

2 Answers2

9

Please try is_connected() instead of isConnected().

starmori
  • 196
  • 5
0

Web3py has started using snakecase instead of CamelCase, So try is_connected()

saty035
  • 142
  • 2
  • 7