question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better error messaging w/ Ape and Brownie in the same environment

See original GitHub issue

Environment information

  • OS: linux
  • Python Version: 3.8.10
  • ape and plugin versions:
$ ape --version
# 0.3.5

$ ape plugins list
  solidity    0.3.2
  foundry     0.2.0
  vyper       0.3.0
  infura      0.3.0
  alchemy     0.3.0

  • Contents of your ape-config.yaml (NOTE: do not post anything private like RPC urls or secrets!):
$ cat ape-config.yaml
# name: gasJar

What went wrong?

Installed and trying to explore. I get this error on ape test. The docs mention an ape-test module, not sure if that’s separate… tried to install but that failed. Since this is a framework I assume that’s already in though. Beside the point tho.

Anyway. Installed. ape test fails with below trace. I don’t have the time to look into in atm. Feel free to close without response. Just wanted to dump this for potential future reference.

  • ape test
`parseb@:~/Desktop/github/gasJar$ ape test
Traceback (most recent call last):
  File "/home/parseb/.local/bin/ape", line 8, in <module>
    sys.exit(cli())
  File "/home/parseb/.local/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/parseb/.local/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/parseb/.local/lib/python3.8/site-packages/ape/_cli.py", line 40, in invoke
    return super().invoke(ctx)
  File "/home/parseb/.local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/parseb/.local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/parseb/.local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/parseb/.local/lib/python3.8/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/parseb/.local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/parseb/.local/lib/python3.8/site-packages/ape_test/_cli.py", line 17, in cli
    return_code = pytest.main([*pytest_args], ["ape_test"])
  File "/home/parseb/.local/lib/python3.8/site-packages/_pytest/config/__init__.py", line 143, in main
    config = _prepareconfig(args, plugins)
  File "/home/parseb/.local/lib/python3.8/site-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/home/parseb/.local/lib/python3.8/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse
    config: Config = outcome.get_result()
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/parseb/.local/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse
    self.parse(args)
  File "/home/parseb/.local/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1283, in parse
    self._preparse(args, addopts=addopts)
  File "/home/parseb/.local/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1172, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/manager.py", line 300, in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
  File "/home/parseb/.local/lib/python3.8/site-packages/_pytest/config/__init__.py", line 436, in register
    ret: Optional[str] = super().register(plugin, name)
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/manager.py", line 127, in register
    hook._maybe_apply_history(hookimpl)
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/hooks.py", line 333, in _maybe_apply_history
    res = self._hookexec(self, [method], kwargs)
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/parseb/.local/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/parseb/.local/lib/python3.8/site-packages/brownie/test/plugin.py", line 50, in pytest_addoption
    parser.addoption(
  File "/home/parseb/.local/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 96, in addoption
    self._anonymous.addoption(*opts, **attrs)
  File "/home/parseb/.local/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 355, in addoption
    raise ValueError("option names %s already added" % conflict)
ValueError: option names {'-I', '--interactive'} already added
`

How can it be fixed?

No clue.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
unparalleled-jscommented, Jul 27, 2022

Sounds like you have Brownie installed in the same environment, which currently is not supported

1reaction
parsebcommented, Aug 8, 2022

Removing brownie ‘solves’ the issue. Having both in the same environment breaks both. Being aware, particularly given that most smart contract devs might not be python power users, is important.

Potentially other extra useful context, installing brownie in ape env. succeeds with:

ERROR: trie 2.0.0a5 has requirement typing-extensions<4,>=3.7.4, but you'll have typing-extensions 4.0.1 which is incompatible.
ERROR: pygithub 1.55 has requirement pyjwt>=2.0, but you'll have pyjwt 1.7.1 which is incompatible.
ERROR: py-multihash 0.2.3 has requirement base58<2.0,>=1.0.2, but you'll have base58 2.1.1 which is incompatible.
ERROR: py-cid 0.3.0 has requirement base58<2.0,>=1.0.2, but you'll have base58 2.1.1 which is incompatible.
ERROR: jupyter-client 7.3.0 has requirement python-dateutil>=2.8.2, but you'll have python-dateutil 2.8.1 which is incompatible.
ERROR: eth-ape 0.3.5 has requirement eth-account==0.5.7, but you'll have eth-account 0.5.9 which is incompatible.
ERROR: eth-ape 0.3.5 has requirement packaging<21.0,>=20.9, but you'll have packaging 21.3 which is incompatible.
ERROR: eth-ape 0.3.5 has requirement pluggy<1.0,>=0.13.1, but you'll have pluggy 1.0.0 which is incompatible.
ERROR: eth-ape 0.3.5 has requirement python-dateutil<3.0,>=2.8.2, but you'll have python-dateutil 2.8.1 which is incompatible.
ERROR: ape-solidity 0.3.2 has requirement packaging<21,>=20.9, but you'll have packaging 21.3 which is incompatible.
ERROR: ape-foundry 0.2.0 has requirement eth-ape<0.3.0,>=0.2.1, but you'll have eth-ape 0.3.5 which is incompatible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Brownie - GitHub
A Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine. - GitHub - eth-brownie/brownie: A Python-based ...
Read more >
phytools.pdf
se with the species specific sampling errors for x. Value. An object of class "brownie.lite" containing the following components:.
Read more >
Brownie Recipe Peppermint Patties Pdf | Internships
Rather than reading a good book with a cup of tea in the afternoon, instead they juggled with some infectious bugs inside their...
Read more >
piH - River Thames Conditions - Environment Agency - GOV.UK
2950 mckinney ave for sale, E41 error code affinity washer, Cirque zavatta animaux, ... What is the best adobe photoshop to buy, Patty...
Read more >
GHIRARDELLI Salted Caramel Premium Brownie Mix, 16 Oz ...
DECADENTLY DELICIOUS: Indulge in rich, decadent GHIRARDELLI chocolate brownies perfectly paired with sweet and salty caramel. PREMIUM MIX: Our carefully ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found