I am new to this. So, how do I connect web3.py with Ganache. I've got Ganache up and running, smart contract deployed. I would like to interact with it from, lets say, a python shell. So, this is what I get:

>>> from web3 import Web3
>>> w3 = Web3(Web3.IPCProvider(''))
>>> w3.isConnected()

I can connect with Ganache using truffle. Is it possible to do it with web3.py?

1 Answer 1



w3 = Web3(Web3.HTTPProvider(''))

Also, make sure that the port is correct (usually ganache-cli listen on 8545)

Source: web3.py quickstart


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.