Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "cannot import name 'getargspec' from 'inspect' " received when running eth-brownie on Windows 11 OS #1309

Closed
MBadea17 opened this issue Feb 3, 2023 · 2 comments
Assignees
Labels
Type: Bug Something isn't working

Comments

@MBadea17
Copy link

MBadea17 commented Feb 3, 2023

After the installation of ocean-lib on Windows 11, the following error was received when calling eth-brownie functions:

(.venv) C:\Users\mihai\Documents\GitHub\ocean-learning>pip list
Package                 Version
----------------------- -----------
aiohttp                 3.8.3
aiosignal               1.2.0
asn1crypto              1.5.1
asttokens               2.0.5
async-timeout           4.0.2
atomicwrites            1.4.1
attrs                   22.1.0
base58                  2.1.1
bitarray                2.6.0
black                   22.10.0
certifi                 2022.9.24
cffi                    1.15.1
charset-normalizer      2.1.1
click                   8.1.3
coincurve               15.0.1
colorama                0.4.6
coloredlogs             15.0.1
cryptography            39.0.0
cytoolz                 0.12.0
dataclassy              0.11.1
Deprecated              1.2.13
eciespy                 0.3.11
eip712                  0.1.0
enforce-typing          1.0.0.post1
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
humanfriendly           10.0
hypothesis              6.27.3
idna                    3.4
inflection              0.5.0
iniconfig               1.1.1
ipfshttpclient          0.8.0a2
json-sempai             0.4.0
jsonschema              3.2.0
lazy-object-proxy       1.7.1
lru-dict                1.1.8
more-itertools          9.0.0
multiaddr               0.0.9
multidict               6.0.2
mypy-extensions         0.4.3
mythx-models            1.9.1
netaddr                 0.8.0
numpy                   1.24.1
ocean-contracts         1.1.8
ocean-lib               2.0.1
packaging               21.3
parsimonious            0.8.1
pathspec                0.10.1
pip                     23.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
pycparser               2.21
pycryptodome            3.15.0
pycryptodomex           3.17
Pygments                2.13.0
pygments-lexer-solidity 0.7.0
PyJWT                   1.7.1
pyOpenSSL               23.0.0
pyparsing               3.0.9
pypiwin32               223
pyreadline3             3.4.1
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
pytz                    2022.7.1
pywin32                 305
PyYAML                  5.4.1
requests                2.28.1
rlp                     2.0.1
scipy                   1.10.0
semantic-version        2.10.0
setuptools              65.5.0
six                     1.16.0
sortedcontainers        2.4.0
toml                    0.10.2
tomli                   2.0.1
toolz                   0.12.0
tqdm                    4.64.1
typing_extensions       4.4.0
urllib3                 1.26.12
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

(.venv) C:\Users\mihai\Documents\GitHub\ocean-learning>python
Python 3.11.1 (tags/v3.11.1:a7a450f, Dec  6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from ocean_lib.web3_internal.utils import connect_to_network
INFO: Could not find files for the given pattern(s).
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\ocean_lib\web3_internal\utils.py", line 9, in <module>
    from brownie import network
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\brownie\__init__.py", line 6, in <module>
    from brownie.project import compile_source, run
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\brownie\project\__init__.py", line 3, in <module>
    from .main import (  # NOQA 401
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\brownie\project\main.py", line 3    from brownie.exceptions import (
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\brownie\exceptions.py", line 6, in <module>
    import eth_abi
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\eth_abi\__init__.py", line 6, in <module>
    from eth_abi.abi import (  # NOQA
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\eth_abi\abi.py", line 1, in <module>
    from eth_abi.codec import (
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\eth_abi\codec.py", line 16, in <module>
    from eth_abi.decoding import (
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\eth_abi\decoding.py", line 14, in <module>
    from eth_abi.base import (
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\eth_abi\base.py", line 7, in <module>
    from .grammar import (
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\eth_abi\grammar.py", line 4, in <module>
    import parsimonious
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\parsimonious\__init__.py", line 9, in <module>
    from parsimonious.grammar import Grammar, TokenGrammar
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\parsimonious\grammar.py", line 14, in <module>
    from parsimonious.expressions import (Literal, Regex, Sequence, OneOf,
  File "c:\Users\mihai\Documents\GitHub\ocean-learning\.venv\Lib\site-packages\parsimonious\expressions.py", line 9, in <module>
    from inspect import getargspec
ImportError: cannot import name 'getargspec' from 'inspect' (C:\Users\mihai\AppData\Local\Programs\Python\Python311\Lib\inspect.py)
>>>

Test environment:

  • OS: Windows 11
  • Python: 3.11.1
  • eth-brownie: 1.19.3
  • vyper: 0.3.7
@MBadea17 MBadea17 added the Type: Bug Something isn't working label Feb 3, 2023
@MBadea17
Copy link
Author

MBadea17 commented Feb 3, 2023

One way to circumvent the error was to replace in the file C:\Users\mihai\Documents\GitHub\ocean-learning.venv\Lib\site-packages\parsimonious\expressions.py the line

from inspect import getargspec

with

from inspect import getfullargspec

as described in ethereum/web3.py#2704 (comment)

Once this modification was done, the command runs as shown below:

(.venv) C:\Users\mihai\Documents\GitHub\ocean-learning>python
Python 3.11.1 (tags/v3.11.1:a7a450f, Dec  6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from ocean_lib.web3_internal.utils import connect_to_network
INFO: Could not find files for the given pattern(s).
>>>

@calina-c
Copy link
Contributor

calina-c commented Feb 9, 2023

Closed by #1316

@calina-c calina-c closed this as completed Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants