-
-
Notifications
You must be signed in to change notification settings - Fork 49
Installing Solidity on OSX
Ben Hauser edited this page Jul 24, 2020
·
2 revisions
The Solidity team does not provide binaries for use with macOS/Darwin. For this reason, py-solc-x
attempts to install Solidity on OSX by building it from the source code.
Sometimes older versions of Solidity fail to build due to incompatible versions of one or more dependencies. When this happens you have two options:
py-solc-x
will make use of any Solidity versions installed using brew
:
brew update
brew upgrade
brew tap ethereum/ethereum
brew install solidity
To install the most recent 0.4.x
/ 0.5.x
version of Solidity you can also use brew install solidity@4
and brew install solidity@5
, respectively.
To install an older version, you can use a Homebrew formula directly from Github:
- Find the commit in
ethereum/homebrew-ethereum
which references the version you wish to install. - Navigate the repository until you have the raw file link for
solidity.rb
at that commit. Make sure the link begins withhttps://raw.githubusercontent.com/
- get it from the "Raw" button in the upper right, immediately above the source code. - Install it using brew:
brew unlink solidity
# e.g. to install v0.5.6
brew install https://raw.githubusercontent.com/ethereum/homebrew-ethereum/1ecf6c60875740133ee51f6167aef9a4f05986e7/solidity.rb
The web3j
team provides compiled OSX binaries for many versions of Solidity. To use a third-party binary with py-solc-x
:
- Download the desired version from
web3j/solidity-darwin-binaries
- Rename the file to
solc-v0.x.y
wherex
andy
correspond to the minor and patch version. - Move the file to the
~/.solcx
directory on your system. It will now be available for use inpy-solc-x
.