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.

Downloaded solc binary cannot be compiled in OSX

See original GitHub issue

Environment information

  • brownie Version: 1.14.6
  • ganache-cli Version: 6.12.2
  • solc Version: 0.6.12
  • Python Version: 3.9.5
  • OS: osx (chip Apple M1)

What was wrong?

I try to run $brownie test or $brownie console but got the error below. It seems that the downloaded solc binary file cannot be compiled. This also happened when I try to run in the project with the solidity version 0.8.4. However, when I run $brownie console outside the solidity project, there is no issue and can use it normally.

brownie test
Brownie v1.14.6 - Python development framework for Ethereum

Downloading from https://solc-bin.ethereum.org/macosx-amd64/solc-macosx-amd64-v0.6.12+commit.27d51765
100%|██████████████████████████████████████| 33.8M/33.8M [00:35<00:00, 944kiB/s]
  File "brownie/test/plugin.py", line 87, in pytest_load_initial_conftests
    active_project = project.load(project_path)
  File "brownie/project/main.py", line 745, in load
    return Project(name, project_path)
  File "brownie/project/main.py", line 180, in __init__
    self.load()
  File "brownie/project/main.py", line 235, in load
    self._compile(changed, self._compiler_config, False)
  File "brownie/project/main.py", line 92, in _compile
    build_json = compiler.compile_and_format(
  File "brownie/project/compiler/__init__.py", line 105, in compile_and_format
    find_solc_versions(solc_sources, install_needed=True, silent=silent)
  File "brownie/project/compiler/solidity.py", line 173, in find_solc_versions
    install_solc(*to_install)
  File "brownie/project/compiler/solidity.py", line 105, in install_solc
    solcx.install_solc(version, show_progress=True)
  File "solcx/install.py", line 466, in install_solc
    raise exc
  File "solcx/install.py", line 459, in install_solc
    _validate_installation(version, solcx_binary_path)
  File "solcx/install.py", line 636, in _validate_installation
    raise SolcInstallationError(
SolcInstallationError: Downloaded binary would not execute, or returned unexpected output. If this issue persists, you can try to compile from source code using `solcx.compile_solc('0.6.12')`.

I looked into this issue but upgrading macos version doesn’t help for this case.

Any suggestion,

Thanks.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
heydamalicommented, Apr 11, 2022

If you ever run into this issue consider downloading python3 version 3.8.10 (specifically). My Mac book (apple M1 chip) came with python3 version 3.8.9 and for some reason, it never worked until I followed this issue and upgraded to 3.8.10 and everything worked.

For how to download python3 version 3.8.10, visit the official python download site https://www.python.org/downloads/

0reactions
parth7326commented, Jan 28, 2022

Update: Solved. To address this, link(alias) the python command to brew’s python3 and reinstall brownie with brew’s pipx.

how to use brew’s pipx to install brownie?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Brownie cannot install solc on OSX - Ethereum Stack Exchange
The web3j team provides compiled OSX binaries for many versions of Solidity. To use a third-party binary: Download the desired version from ...
Read more >
py-solc-x Documentation
Install a version of solc by downloading and compiling source code. This function is only available when using Linux or OSX. Arguments: version ......
Read more >
Installing the Solidity Compiler
No information is available for this page.
Read more >
py-solc-x 0.5.0 - PyPI
Python wrapper around the solc binary with 0.5.x support. ... 0.4.x versions are available on OSX if they have been installed via brew,...
Read more >
Multiple solidity compiler versions in PATH - Stack Overflow
I'm new to mac and it was necessary to make the binary executable by running: chmod 755 ${HOME}/bin/binary.
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