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 550 forks source link

Unable to install eth-brownie on Python 3.10.6 #1701

Closed pulsedynamic closed 7 months ago

pulsedynamic commented 1 year ago

Environment information

We are not able to install eth-brownie on any Python 3.10 version because of PyYaml dependencies. Our pipelines keep on failing because of this :

What was wrong?

It seems PyYaml installation fails with versions up until 6.0.0 because of Cython 3 More additional links and info:

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.



### How can it be fixed?

Perhaps pinning PyYaml to any version >= 6.0.0 should fix this issue
IgnjatR commented 1 year ago

+1

michaelnowotny commented 1 year ago

+1

DimaDDM commented 1 year ago

+1

Nov1kov commented 1 year ago

Workaround: pip install "cython<3.0.0" && pip install --no-build-isolation eth-brownie

DimaDDM commented 1 year ago

Workaround

cython<3.0.0
web3==5.31.3
py-solc-x==1.1.1
eth-brownie==1.19.3
pulsedynamic commented 1 year ago

Thanks for the workarounds

Both @DimaDDM and @Nov1kov solutions work, but only with pip

Tried the following with Poetry but seems to fail on the same spot :(

09tangriro commented 1 year ago

+1

For poetry install eth-brownie=^1.19.3. It works fine with Python 3.8 and 3.9, but 3.10 fails because of pyyaml==5.4.1 :(

Interestingly, for some reason using poetry 1.4.2 works fine on my local machine (M1 mac) but fails on a ubuntu github actions run, while poetry 1.5.1 fails on everything. Doubly interesting is this only started happening recently, both runs below happen with the same poetry.lock dependencies and poetry version (1.5.1):

Screenshot 2023-07-22 at 13 11 36 Screenshot 2023-07-22 at 13 13 04

Agree that a fix could be to do pyyaml=^6.0.0 rather than pinning to specifically v5.4.1.

zklim commented 1 year ago

+1

pulsedynamic commented 1 year ago

Is eth-brownie even actively maintained ?

BATMAH69 commented 1 year ago

This works with poetry (line should be without && )

poetry run pip install "cython<3.0" pyyaml==5.4.1 --no-build-isolation
poetry install
0xKalakaua commented 1 year ago

Anyone got a solution using pipenv?

MidnightLady commented 1 year ago

We should downgrading PyYAML to 5.3.1 due to 5.4.1 failing to build for Cython<3

hot fix for pip: pip install "cython<3.0.0" && pip install --no-build-isolation pyyaml==5.4.1 pip install eth-brownie

chuanqin3 commented 1 year ago

I have tried all solutions advised above and online and none works for me, even after I tried different Python versions from 3.9 to 3.11. Disappointed and I may stay away from Brownie. The developer should make the installation easy at the first place.

0xViva commented 1 year ago

We should downgrading PyYAML to 5.3.1 due to 5.4.1 failing to build for Cython<3

hot fix for pip: pip install "cython<3.0.0" && pip install --no-build-isolation pyyaml==5.4.1 pip install eth-brownie

This or, this:

https://stackoverflow.com/questions/75230007/error-installing-eth-brownie-with-pipx-install-eth-brownie

Installing python 3.9.something and following these steps seems to have gotten Brownie installed and added to path.

But now i'm encountering a new error when trying to run brownie for anything:

(demo-app-3.9.17) user@user-Laptop demo-app % brownie
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 631, in _build_master
    ws.require(__requires__)
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 968, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 829, in resolve
    dist = self._resolve_dist(
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 875, in _resolve_dist
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (wheel 0.41.2 (/opt/homebrew/lib/python3.9/site-packages), Requirement.parse('wheel==0.37.1'), {'eth-brownie'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/bin/brownie", line 33, in <module>
    sys.exit(load_entry_point('eth-brownie==1.19.3', 'console_scripts', 'brownie')())
  File "/opt/homebrew/bin/brownie", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/opt/homebrew/Cellar/python@3.9/3.9.18/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/metadata.py", line 86, in load
    module = import_module(match.group('module'))
  File "/opt/homebrew/Cellar/python@3.9/3.9.18/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/opt/homebrew/lib/python3.9/site-packages/eth_brownie-1.19.3-py3.9.egg/brownie/__init__.py", line 6, in <module>
    from brownie.project import compile_source, run
  File "/opt/homebrew/lib/python3.9/site-packages/eth_brownie-1.19.3-py3.9.egg/brownie/project/__init__.py", line 3, in <module>
    from .main import (  # NOQA 401
  File "/opt/homebrew/lib/python3.9/site-packages/eth_brownie-1.19.3-py3.9.egg/brownie/project/main.py", line 37, in <module>
    from brownie.exceptions import (
  File "/opt/homebrew/lib/python3.9/site-packages/eth_brownie-1.19.3-py3.9.egg/brownie/exceptions.py", line 6, in <module>
    import eth_abi
  File "/opt/homebrew/lib/python3.9/site-packages/eth_abi-2.2.0-py3.9.egg/eth_abi/__init__.py", line 4, in <module>
    import pkg_resources
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3328, in <module>
    def _initialize_master_working_set():
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3302, in _call_aside
    f(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3340, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 633, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 646, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 829, in resolve
    dist = self._resolve_dist(
  File "/opt/homebrew/lib/python3.9/site-packages/pkg_resources/__init__.py", line 870, in _resolve_dist
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'wheel==0.37.1' distribution was not found and is required by eth-brownie

Strange error, because I can confirm that wheel=0.37.1 is installed by typing pip list:

(demo-app-3.9.17) user@user-Laptop demo-app % pip3 list
Package                 Version
----------------------- ---------
aiohttp                 3.8.3
aiosignal               1.2.0
argcomplete             3.1.1
asttokens               2.0.5
async-timeout           4.0.2
attrs                   22.1.0
base58                  2.1.1
bitarray                2.6.0
black                   22.10.0
certifi                 2022.9.24
charset-normalizer      2.1.1
clang                   16.0.1.1
click                   8.1.3
Cython                  3.0.0
cytoolz                 0.12.0
dataclassy              0.11.1
eip712                  0.1.0
eth-abi                 2.2.0
eth-account             0.5.9
eth-brownie             1.19.3
eth-event               1.2.3
eth-hash                0.3.3
eth-keyfile             0.5.1
eth-keys                0.3.4
eth-rlp                 0.2.1
eth-typing              2.3.0
eth-utils               1.10.0
execnet                 1.9.0
frozenlist              1.3.1
hexbytes                0.2.3
hypothesis              6.27.3
idna                    3.4
inflection              0.5.0
iniconfig               1.1.1
ipfshttpclient          0.8.0a2
jsonschema              3.2.0
lazy-object-proxy       1.7.1
lru-dict                1.1.8
multiaddr               0.0.9
multidict               6.0.2
mypy-extensions         0.4.3
mythx-models            1.9.1
netaddr                 0.8.0
packaging               21.3
parsimonious            0.8.1
pathspec                0.10.1
pip                     23.2.1
pipx                    1.2.0
platformdirs            2.5.2
pluggy                  1.0.0
prompt-toolkit          3.0.31
protobuf                3.19.5
psutil                  5.9.2
py                      1.11.0
py-solc-ast             1.2.9
py-solc-x               1.1.1
pycryptodome            3.15.0
Pygments                2.13.0
pygments-lexer-solidity 0.7.0
PyJWT                   1.7.1
pyparsing               3.0.9
pyrsistent              0.18.1
pytest                  6.2.5
pytest-forked           1.4.0
pytest-xdist            1.34.0
python-dateutil         2.8.1
python-dotenv           0.16.0
pythx                   1.6.1
PyYAML                  5.4.1
requests                2.28.1
rlp                     2.0.1
semantic-version        2.10.0
setuptools              68.1.2
six                     1.16.0
sortedcontainers        2.4.0
toml                    0.10.2
tomli                   2.0.1
toolz                   0.12.0
tqdm                    4.64.1
typed-ast               1.5.5
typing_extensions       4.4.0
urllib3                 1.26.12
userpath                1.9.0
varint                  1.0.2
vvm                     0.1.0
vyper                   0.3.7
wcwidth                 0.2.5
web3                    5.31.3
websockets              9.1
wheel                   0.37.1
wrapt                   1.14.1
yarl                    1.8.1
liam-ot commented 1 year ago

eth-brownie is no longer maintained, it should not be used

ape is the successor of eth-brownie you can view a tutorial on how to port over to ape from brownie here

also here is the discord for the ape framework

MidnightLady commented 1 year ago

eth-brownie is no longer maintained, it should not be used

ape is the successor of eth-brownie you can view a tutorial on how to port over to ape from brownie here

also here is the discord for the ape framework

sound great, does it mixed from brownie and foundry?

liam-ot commented 1 year ago

@MidnightLady yes, there is foundry support

ejsnews commented 10 months ago

eth-brownie or eth-ape with pyethash are unable to be installed and run seriously, one day that will be no longer maintained, so don't lose your time to repair the zombie codes coming from PyPi.org or academy.apeworx.io Try to build you own solution to save your time. Mainly that must come from github, not others websites.

magic-thomas commented 9 months ago

3.10 / 3.11 all failed. time waisting.

iamdefinitelyahuman commented 7 months ago

Support for 3.10-3.12 added in v1.20.0. But also @liam-ot is correct, this project is no longer actively maintained.

liam-ot commented 7 months ago

@iamdefinitelyahuman just wanna say thanks to you and all other contributors for having made this in the first place, it was a huge boost to my learning smart contract development when i began!