The web3.auto is no longer included in web3 library it is removed from new and stable library, so in the latest and stable version of web3 library you have to manually provide the provider.
Providers are how web3 connects to the blockchain. The Web3 library comes with a the following built-in providers that should be suitable for most normal use cases.
- web3.HTTPProvider for connecting to http and https based JSON-RPC servers.
- web3.IPCProvider for connecting to ipc socket based JSON-RPC servers.
The HTTPProvider takes the full URI where the server can be found. For local development this would be something like http://localhost:8545.
The IPCProvider takes the filesystem path where the IPC socket can be found. If no argument is provided it will use the default path for your operating system.
>>> from web3 import Web3, HTTPProvider, IPCProvider
# Note that you should create only one RPCProvider per
# process, as it recycles underlying TCP/IP network connections between
# your process and Ethereum node
>>> web3 = Web3(HTTPProvider('http://localhost:8545'))
# or for an IPC based connection
>>> web3 = Web3(IPCProvider())
For more information please read docs
Note: when install web3 library install the latest one.
and instead what you are doing done something like:
from web3 import Web3, HTTPProvider
# For HTTPProvider
w3 = Web3(HTTPProvider('http://localhost:8545.'))