Closed merc1er closed 1 year ago
On macOS (M1 chip), in a clean virtualenv:
pip install eth-ape
ape init
ape test
That's a very strange one, @helloibis has an M1 mac and can maybe help debug this
@merc1er @fubuloubu yep, able to reproduce this! Going to take a look now
@fubuloubu @merc1er seems to be an issue with the web3.py
dependency of protobuf, even on the latest web3.py
pre-release 6.0.0b5
In the meantime I was able to manually fix the import error by downgrading protobuf by a point version:
(venv) $ pip uninstall protobuf
(venv) $ pip install protobuf==3.20.1
There's an upstream issue at https://github.com/ethereum/web3.py/issues/2654, but I'm not sure how much work getting them on 4.x will be. I run into this issue if I install the latest protobuf rather than downgrading to 3.20.1
:
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
3.20.2 was released on Sept. 13th. We could pin to 3.20.1
in Ape. Currently, our web3.py
version is pinned anyway, so it wouldn't cause any unexpected problems. Then when we upgrade web3.py to its production release, we can delete the protobuf pin then.
This has been fixed upstream and should be in a release next week
https://github.com/ethereum/web3.py/pull/2657
Once their release is out we can update our dependency!
Thanks for the quick turnaround.
I can confirm #1071 works with protobuf==3.20.1
and fixes this for me.
Web3 just released their new beta version, so I've opened up https://github.com/ApeWorX/ape/pull/1082 to see about just updating our dependency. Will close out #1071 once we find out if the new PR suffices 🙂
Environment information
ape
and plugin versions:ape-config.yaml
(NOTE: do not post anything private like RPC urls or secrets!):What went wrong?
When running
ape test
(orpytest
), I am getting the following error:Full traceback:
```shell ❯ ape test Traceback (most recent call last): File "/Users/merc1er/.pyenv/versions/ape/bin/ape", line 8, inThis however works fine in GitHub actions (ubuntu-latest).