0

So I had gotten this error 2 days ago when I started to install brownie and use it for developing using vyper, So I factory reset my whole laptop only to get the same error...

I followed the installation instruction on (https://eth-brownie.readthedocs.io/en/latest/install.html) in my terminal and when I attempt to even type brownie and enter it i get the ModuleNotFoundError

@Wealthanaires-MacBook-Air brownie % brownie
Traceback (most recent call last):
  File "/Users/Desktop/Programming/Github/brownie/venv/bin/brownie", line 33, in <module>
    sys.exit(load_entry_point('eth-brownie==1.19.2', 'console_scripts', 'brownie')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Desktop/Programming/Github/brownie/venv/bin/brownie", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/metadata/__init__.py", line 198, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/Desktop/Programming/Github/brownie/venv/lib/python3.11/site-packages/eth_brownie-1.19.2-py3.11.egg/brownie/__init__.py", line 6, in <module>
    from brownie.project import compile_source, run
  File "/Users/Desktop/Programming/Github/brownie/venv/lib/python3.11/site-packages/eth_brownie-1.19.2-py3.11.egg/brownie/project/__init__.py", line 3, in <module>
    from .main import (  # NOQA 401
  File "/Users/Desktop/Programming/Github/brownie/venv/lib/python3.11/site-packages/eth_brownie-1.19.2-py3.11.egg/brownie/project/main.py", line 19, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

My Focus and only focus at the moment is to install and run brownie so I can use vyper any thoughts/ideas will be much appreciated

1 Answers1

0

I think you are using vyper with python virtualenv. First of all, you need to install vyper with the following command without virtualenv. Brownie needs a dependency from one of the vyper-based packages.

pip install vyper

You need to install brownie with the pipx (not pip command)

python3 -m pip install --user pipx
python3 -m pipx ensurepath

Upgrade the version of pipx with the following command:

python3 -m pip install --user -U pipx

pipx install eth-brownie

After installing the brownie tool, you need to open a new terminal and type the following commands:

mkdir brownietest
cd brownietest
brownie init --force
brownie compile

I have tested brownie and vyper with the version as follows under Ubuntu 20.04:

Brownie v1.19.3 Vyper 0.3.1

Sample Contract under the brownietest/contracts

    # @version ^0.3.7

funders: HashMap[address, uint256]
beneficiary: address
deadline: public(uint256)
goal: public(uint256)
timelimit: public(uint256)

# Setup global variables
@external
def __init__(_beneficiary: address, _goal: uint256, _timelimit: uint256):
    self.beneficiary = _beneficiary
    self.deadline = block.timestamp + _timelimit
    self.timelimit = _timelimit
    self.goal = _goal

# Participate in this crowdfunding campaign
@external
@payable
def participate():
    assert block.timestamp < self.deadline, "deadline not met (yet)"

    self.funders[msg.sender] += msg.value

# Enough money was raised! Send funds to the beneficiary
@external
def finalize():
    assert block.timestamp >= self.deadline, "deadline has passed"
    assert self.balance >= self.goal, "the goal has not been reached"

    selfdestruct(self.beneficiary)

# Let participants withdraw their fund
@external
def refund():
    assert block.timestamp >= self.deadline and self.balance < self.goal
    assert self.funders[msg.sender] > 0

    value: uint256 = self.funders[msg.sender]
    self.funders[msg.sender] = 0

    send(msg.sender, value)

Console output after typing brownie compile command:

Brownie v1.19.3 - Python development framework for Ethereum

Project has been compiled. Build artifacts saved at 'directory path'
zoint
  • 108
  • 2
  • 15