eth-brownie / brownie

A Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine.
https://eth-brownie.readthedocs.io
MIT License
2.64k stars 547 forks source link

cytoolz error when running brownie on Python 3.10 #1381

Open weiss-d opened 2 years ago

weiss-d commented 2 years ago

Environment information

What was wrong?

Every command, even brownie --help prints out this error:

Traceback (most recent call last):
  File "/home/weiss-d/.local/bin/brownie", line 5, in <module>
    from brownie._cli.__main__ import main
  File "/home/weiss-d/.local/pipx/venvs/eth-brownie/lib/python3.10/site-packages/brownie/__init__.py", line 6, in <module>
    from brownie.project import compile_source, run
  File "/home/weiss-d/.local/pipx/venvs/eth-brownie/lib/python3.10/site-packages/brownie/project/__init__.py", line 3, in <module>
    from .main import (  # NOQA 401
  File "/home/weiss-d/.local/pipx/venvs/eth-brownie/lib/python3.10/site-packages/brownie/project/main.py", line 44, in <module>
    from brownie.network import web3
  File "/home/weiss-d/.local/pipx/venvs/eth-brownie/lib/python3.10/site-packages/brownie/network/__init__.py", line 4, in <module>
    from .account import Accounts
  File "/home/weiss-d/.local/pipx/venvs/eth-brownie/lib/python3.10/site-packages/brownie/network/account.py", line 12, in <module>
    import eth_account
  File "/home/weiss-d/.local/pipx/venvs/eth-brownie/lib/python3.10/site-packages/eth_account/__init__.py", line 1, in <module>
    from eth_account.account import (  # noqa: F401
  File "/home/weiss-d/.local/pipx/venvs/eth-brownie/lib/python3.10/site-packages/eth_account/account.py", line 8, in <module>
    from cytoolz import (
  File "/home/weiss-d/.local/pipx/venvs/eth-brownie/lib/python3.10/site-packages/cytoolz/__init__.py", line 3, in <module>
    from .functoolz import *
ImportError: /home/weiss-d/.local/pipx/venvs/eth-brownie/lib/python3.10/site-packages/cytoolz/functoolz.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send
damiaanh commented 2 years ago

I'm having the same error. Brownie always returns this error, also with things like brownie --version. Python version: 3.10.1 pip version 20.3.4 pipx version: 0.16.4 OS: Garuda Linux (Arch-based) Kernel: linux-zen 5.15.8 zen 1-1

damiaanh commented 2 years ago

I was able to create a workaround by downgrading my Python version to 3.9.9. I specified to use this version while creating a virtualenv. Then, I installed Brownie through pip.

I think the issue lays with Cytoolz and/or Cython not functioning properly with python 3.10.

gnattishness commented 2 years ago

I believe this is the same issue as #1371 Brownie's vyper dependency does not currently support 3.10. And the older brownie 1.16.4 (1.17.2 is the current latest release) uses an older version of cytoolz that does not support 3.10 (even though 1.17.2 has cytoolz==0.11.2, which supports 3.10 )