Installing web3.py
The web3.py library is a Python library. So, you could install it the way you install any Python library. The recommended way is to use a Python virtual environment.
First, create a Python virtual environment:
$ python3.10 -m venv .venv $ source .venv/bin/activate
Then, install the library like so:
(.venv) $ pip install web3
Now that you’ve installed the web3.py
library, it’s time to test it with blockchains. We’re going to test it with development blockchains. In the previous chapter, you used the development blockchain embedded in Remix IDE. Although it lives in the browser, there are development blockchains that run outside the browser.
Ganache
Ganache is touted as the personal Ethereum blockchain. Using this application, you can easily experiment with the blockchain. One of the unique features of this application is that it has a graphical interface. The other blockchains usually only have a command-line interface.
The...