smartcontractkit / full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
MIT License
10.69k stars 2.89k forks source link

Issue with brownie install #501

Open narainp opened 2 years ago

narainp commented 2 years ago

Installed brownie and updated env variables: python3 -m pip install --user pipx python3 -m pipx ensurepath pipx install eth-brownie were successful.

But it seems the verification fails:

C:\brownie_simple_storage> brownie
INFO: Could not find files for the given pattern(s). Traceback (most recent call last): File "C:\Python37\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "c:\users\parik.local\bin\brownie.exe__main.py", line 4, in File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\brownie__init.py", line 6, in from brownie.project import compile_source, run File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\project__init.py", line 3, in from .main import ( # NOQA 401 File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\project\main.py", line 41, in from brownie.network import web3 File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\init.py", line 4, in from .account import Accounts File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\account.py", line 29, in from .gas.bases import GasABC File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\gas\bases.py", line 7, in from brownie.network.web3 import web3 File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\web3.py", line 208, in web3 = Web3() File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\web3.py", line 30, in init self.enable_unstable_package_management_api() File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\web3\main.py", line 289, in enable_unstable_package_management_api from web3.pm import PM # noqa: F811 File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\web3\pm.py", line 36, in from ethpm import ( File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\ethpm\init__.py", line 8, in from .package import Package # noqa: F401 File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\ethpm\package.py", line 60, in from ethpm.uri import ( File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\ethpm\uri.py", line 15, in from ethpm._utils.backend import ( File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\ethpm_utils\backend.py", line 13, in from ipfshttpclient.exceptions import ( File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\ipfshttpclient\init__.py", line 11, in from .client import DEFAULT_ADDR, DEFAULT_BASE from . import bitswap File "C:\Users\parik.local\pipx\venvs\eth-brownie\lib\site-packages\ipfshttpclient\client\bitswap.py", line 3, in from . import base def returns_no_item(func: _inner_func_t[ty.NoReturn]) -> _returns_single_wrapper_t: return func(*args, **kwds) File "C:\Python37\lib\typing.py", line 824, in class_getitem__ params = tuple(_type_check(p, msg) for p in params) File "C:\Python37\lib\typing.py", line 824, in params = tuple(_type_check(p, msg) for p in params) File "C:\Python37\lib\typing.py", line 135, in _type_check raise TypeError(f"Plain {arg} is not valid as type argument") TypeError: Plain typing.NoReturn is not valid as type argument

cromewar commented 2 years ago

Hello @narainp try installing brownie with pip instead pipx

narainp commented 2 years ago

Thanks. Retried by following the steps again. Both using pip and pipx, everything seems to be installed without errors. But, the test fails still...

C:\brownie_simple_storage> brownie --version INFO: Could not find files for the given pattern(s). Traceback (most recent call last): File "C:\Python37\Scripts\brownie-script.py", line 33, in sys.exit(load_entry_point('eth-brownie==1.17.2', 'console_scripts', 'brownie')())
File "C:\Python37\Scripts\brownie-script.py", line 25, in importlib_load_entry_point
return next(matches).load() File "C:\Python37\lib\site-packages\importlib_metadata__init.py", line 167, in load module = import_module(match.group('module')) File "C:\Python37\lib\importlib__init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 953, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 953, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "C:\Python37\lib\site-packages\brownie__init.py", line 6, in from brownie.project import compile_source, run File "C:\Python37\lib\site-packages\brownie\project__init.py", line 3, in from .main import ( # NOQA 401 File "C:\Python37\lib\site-packages\brownie\project\main.py", line 41, in from brownie.network import web3 File "C:\Python37\lib\site-packages\brownie\network\init.py", line 4, in from .account import Accounts File "C:\Python37\lib\site-packages\brownie\network\account.py", line 29, in from .gas.bases import GasABC File "C:\Python37\lib\site-packages\brownie\network\gas\bases.py", line 7, in from brownie.network.web3 import web3 File "C:\Python37\lib\site-packages\brownie\network\web3.py", line 208, in web3 = Web3() File "C:\Python37\lib\site-packages\brownie\network\web3.py", line 30, in init self.enable_unstable_package_management_api() File "c:\python37\lib\site-packages\web3-5.25.0-py3.7.egg\web3\main.py", line 356, in enable_unstable_package_management_api from web3.pm import PM # noqa: F811 File "c:\python37\lib\site-packages\web3-5.25.0-py3.7.egg\web3\pm.py", line 36, in from ethpm import ( File "c:\python37\lib\site-packages\web3-5.25.0-py3.7.egg\ethpm\init__.py", line 19, in from .package import Package # noqa: E402, F401 File "c:\python37\lib\site-packages\web3-5.25.0-py3.7.egg\ethpm\package.py", line 61, in from ethpm.uri import ( File "c:\python37\lib\site-packages\web3-5.25.0-py3.7.egg\ethpm\uri.py", line 18, in from ethpm._utils.backend import ( File "c:\python37\lib\site-packages\web3-5.25.0-py3.7.egg\ethpm_utils\backend.py", line 13, in from ipfshttpclient.exceptions import ( File "c:\python37\lib\site-packages\ipfshttpclient-0.8.0a2-py3.7.egg\ipfshttpclient\init__.py", line 11, in from .client import DEFAULT_ADDR, \ File "c:\python37\lib\site-packages\ipfshttpclient-0.8.0a2-py3.7.egg\ipfshttpclient\client\init__.py", line 26, in from . import base File "c:\python37\lib\site-packages\ipfshttpclient-0.8.0a2-py3.7.egg\ipfshttpclient\client\base.py", line 255, in def returns_no_item(func: _inner_func_t[ty.NoReturn]) -> _returns_single_wrapper_t: File "C:\Python37\lib\typing.py", line 251, in inner return func(*args, **kwds) File "C:\Python37\lib\typing.py", line 824, in class_getitem__ params = tuple(_type_check(p, msg) for p in params) File "C:\Python37\lib\typing.py", line 824, in params = tuple(_type_check(p, msg) for p in params) File "C:\Python37\lib\typing.py", line 135, in _type_check raise TypeError(f"Plain {arg} is not valid as type argument") TypeError: Plain typing.NoReturn is not valid as type argument

cromewar commented 2 years ago

It seems you have some conflicts with your python packages on windows, there is some steps that should help:

  1. install visual studio and it's pythons development tools.
  2. use python virtualenv (install it using pip), this allows you to to manage python virtual environments which independent libraries.
  3. Use WSL (windows subsystem for linux) and manage all your python stuff there. (recommended)

I hope this info might be helpful.