Repository: ethereum/web3.py

Issue:
pip install web3, errors due to incompatible version of eth-rlp
* Version: 5.28.0
* Python: 3.8
* OS: linux
* `pip freeze` output

```
appdirs==1.4.3
certifi==2019.11.28
chardet==3.0.4
dbus-python==1.2.16
distlib==0.3.0
distro-info===0.23ubuntu1
filelock==3.0.12
idna==2.8
importlib-metadata==1.5.0
more-itertools==4.2.0
netifaces==0.10.4
PyGObject==3.36.0
pymacaroons==0.13.0
PyNaCl==1.3.0
python-apt==2.0.0+ubuntu0.20.4.6
python-debian===0.1.36ubuntu1
PyYAML==5.3.1
requests==2.22.0
requests-unixsocket==0.2.0
six==1.14.0
ubuntu-advantage-tools==27.4
urllib3==1.25.8
virtualenv==20.0.17
zipp==1.0.0

```


### What was wrong?


When trying to install web3.py in a new virtualenv, on a new installation of Ubuntu 20.04, the following error is thrown:

```

virtualenv -p python3.8 venv
source venv/bin/activate
pip install web3
...
ERROR: eth-rlp 0.3.0 has requirement eth-utils<3,>=2.0.0, but you'll have eth-utils 1.10.0 which is incompatible.
...

```


Discussion:
This might be related to #1321 I believe, have you tried to upgrade your `pip` to the latest `pip` version using `pip install --upgrade pip` ?
Triggered by this change presumably:
https://github.com/ethereum/eth-rlp/pull/14

I believe that change was released with a minor version bump (which is okay as a breaking change, when the major version is 0)

But I'm guessing that there isn't a minor version constraint on `eth-rlp` to keep it below `v0.3` until eth-utils v2 is supported, wherever eth-rlp is required (I don't see it in web3, so must be a sub-dependency)
Here's the dependencies resolution attempted by `pipenv` :

```
ERROR: Could not find a version that matches eth-utils<2,<2.0.0,<3,>=1.0.0-beta.1,>=1.0.2,>=1.2.0,>=1.3.0,>=1.8.2,>=1.9.5,>=2.0.0 (from web3==5.29.2->-r /tmp/pipenvqt9ls3hmrequirements/pipenv-ucnr67z5-constraints.txt (line 2))
Tried: 0.7.0, 0.7.0, 0.7.1, 0.7.1, 0.7.2, 0.7.2, 0.7.3, 0.7.3, 0.7.4, 0.7.4, 0.8.0, 0.8.0, 0.8.1, 0.8.1, 1.0.1, 1.0.1, 1.0.2, 1.0.2, 1.0.3, 1.0.3, 1.1.1, 1.1.1, 1.1.2, 1.1.2, 1.2.0, 1.2.0, 1.2.1, 1.2.1, 1.2.2, 1.2.2, 1.3.0, 1.3.0, 1.4.0, 1.4.0, 1.4.1, 1.4.1, 1.5.0, 1.5.0, 1.5.1, 1.5.1, 1.5.2, 1.5.2, 1.6.0, 1.6.0, 1.6.1, 1.6.1, 1.6.2, 1.6.2, 1.6.3, 1.6.3, 1.6.4, 1.6.4, 1.7.0, 1.7.0, 1.8.0, 1.8.0, 1.8.1, 1.8.1, 1.8.2, 1.8.2, 1.8.3, 1.8.3, 1.8.4, 1.8.4, 1.9.0, 1.9.0, 1.9.2, 1.9.2, 1.9.3, 1.9.3, 1.9.4, 1.9.4, 1.9.5, 1.9.5, 1.10.0, 1.10.0, 2.0.0, 2.0.0
Skipped pre-versions: 1.0.0b1, 1.0.0b1, 1.0.0b2, 1.0.0b2, 1.3.0b0, 2.0.0a0, 2.0.0a0
There are incompatible versions in the resolved dependencies:
  eth-utils<2,>=1.0.2 (from rlp==2.0.1->eth-account==0.5.7->web3==5.29.2->-r /tmp/pipenvqt9ls3hmrequirements/pipenv-ucnr67z5-constraints.txt (line 2))
  eth-utils<2,>=1.3.0 (from eth-account==0.5.7->web3==5.29.2->-r /tmp/pipenvqt9ls3hmrequirements/pipenv-ucnr67z5-constraints.txt (line 2))
  eth-utils<2.0.0,>=1.0.0-beta.1 (from eth-keyfile==0.5.1->eth-account==0.5.7->web3==5.29.2->-r /tmp/pipenvqt9ls3hmrequirements/pipenv-ucnr67z5-constraints.txt (line 2))
  eth-utils<2.0.0,>=1.2.0 (from eth-abi==2.1.1->web3==5.29.2->-r /tmp/pipenvqt9ls3hmrequirements/pipenv-ucnr67z5-constraints.txt (line 2))
  eth-utils<2.0.0,>=1.8.2 (from eth-keys==0.3.4->eth-account==0.5.7->web3==5.29.2->-r /tmp/pipenvqt9ls3hmrequirements/pipenv-ucnr67z5-constraints.txt (line 2))
  eth-utils<2.0.0,>=1.9.5 (from web3==5.29.2->-r /tmp/pipenvqt9ls3hmrequirements/pipenv-ucnr67z5-constraints.txt (line 2))
  eth-utils<3,>=2.0.0 (from eth-rlp==0.3.0->eth-account==0.5.7->web3==5.29.2->-r /tmp/pipenvqt9ls3hmrequirements/pipenv-ucnr67z5-constraints.txt (line 2))
```

so it looks like the issue is with this tree : `eth-rlp==0.3.0->eth-account==0.5.7->web3==5.29.2` from https://github.com/ethereum/eth-account/commit/7c8e21031d7ea1b14bbe4d0bd5bf4ff411be0095

Adding  `eth-rlp<0.3` to web3.py requirements should help
Note that this change is moot by web3 v6, which uses eth-utils v2. So the fix only has to be on the v5 branch.
We did some testing and were able to reproduce with Python 3.8, but were able to get it resolved with an upgraded pip version: 
```
$ pip install --upgrade pip
$ pip --version
pip 22.1.2
``` 

I'll add a pin for `eth-rlp` in web3py, but if you can, upgrading your pip seems like a good workaround in the meantime. 

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -79,6 +79,9 @@
         "eth-abi>=2.0.0b6,<3.0.0",
         "eth-account>=0.5.7,<0.6.0",
         "eth-hash[pycryptodome]>=0.2.0,<1.0.0",
+        # eth-account allows too broad of an eth-rlp dependency.
+        # This eth-rlp pin can be removed once it gets tightened up in eth-account
+        "eth-rlp<0.3",
         "eth-typing>=2.0.0,<3.0.0",
         "eth-utils>=1.9.5,<2.0.0",
         "hexbytes>=0.1.0,<1.0.0",


Test patch: