solc-select
solc-select is a Python library and CLI tool (version 1.2.0) that simplifies the management and switching between different versions of the Solidity compiler (`solc`). It provides two command-line utilities: `solc-select` for installing and setting compiler versions, and `solc` as a wrapper that invokes the selected compiler. It maintains an active development status with a steady release cadence, primarily focusing on CLI improvements and platform compatibility.
Common errors
-
solc-select version changes, but solc --version does not match.
cause Multiple `solc` installations on the system (e.g., via Homebrew, apt) conflict with `solc-select`'s managed binaries.fixUninstall any other `solc` installations. `solc-select` works by wrapping its own installed `solc` binaries. -
SSL: CERTIFICATE_VERIFY_FAILED on running solc-select commands
cause Python distributions on macOS (OS X) often lack certificates for validating SSL connections, a common issue since Python 3.6.fixRun `/Applications/Python <version>/Install Certificates.command` or `pip3 install certifi` to update certificate authorities. -
OSError: [Errno 86] Bad CPU type in executable (on macOS ARM/M1/M2)
cause Attempting to use an Intel-only Solidity binary (versions older than 0.8.5) on an ARM-based macOS system without Rosetta 2 installed.fixInstall Rosetta 2 using `/usr/sbin/softwareupdate --install-rosetta --agree-to-license`, or install and use a `solc` version 0.8.5 or newer which has native ARM64 support. -
argparse.ArgumentTypeError: '0.8.9' must be installed prior to use.
cause The `solc-select use` command was executed for a Solidity version that has not yet been installed.fixFirst install the version: `solc-select install 0.8.9`. Alternatively, use `solc-select use 0.8.9 --always-install` to install it if not present. -
cannot execute binary file: Exec format error (on Linux ARM64)
cause On Linux ARM64 systems (e.g., Docker on Apple Silicon, AWS Graviton), older `solc-select` versions (especially for `solc` versions before 0.8.31) might mistakenly download and attempt to run x86_64 binaries.fixUpgrade `solc-select` to its latest version. For `solc` versions less than 0.8.31, ensure QEMU (`qemu-x86_64`) and necessary `libc` binaries are installed and configured for x86_64 emulation.
Warnings
- gotcha If `solc --version` does not reflect the version set by `solc-select use <version>`, it often indicates a conflicting `solc` installation (e.g., via Homebrew or apt). `solc-select` manages its own binaries.
- breaking On macOS ARM (M1/M2/M3 Macs), `solc-select` provides native ARM64 support for versions 0.8.5-0.8.23 and universal binary support for 0.8.24+. Older versions (<0.8.5) are Intel-only and require Rosetta 2 to be installed.
- gotcha Running `solc-select` commands, especially `install`, might encounter `SSL: CERTIFICATE_VERIFY_FAILED` errors on OS X (macOS) due to changes in Python 3.6+ regarding SSL certificate validation.
- gotcha On Linux ARM64 (aarch64) systems (e.g., Docker on Apple Silicon, AWS Graviton), older versions of `solc-select` might incorrectly download x86_64 binaries, leading to 'cannot execute binary file: Exec format error'. Native ARM64 support for Linux begins with `solc` 0.8.31+.
- gotcha `solc-select use <version>` will raise an `ArgumentTypeError` if the specified Solidity version has not been previously installed using `solc-select install <version>`.
Install
-
pip install solc-select
Quickstart
# Install a specific Solidity version solc-select install 0.8.19 # Set the global Solidity version solc-select use 0.8.19 # Verify the active version solc --version # List all installed versions solc-select versions # Install and use in one command (will download if not installed) solc-select use 0.8.20 --always-install