The recommended way to install SCons is from the Python Package Index (PyPI):
python -m pip install scons
If you prefer not to install to the Python system location, or do not have privileges to do so, you can add a flag to install to a location specific to your own account and Python version:
python -m pip install --user scons
For those users using Anaconda or Miniconda, use the conda installer instead, so the scons install location will match the version of Python that system will be using. For example:
conda install -c conda-forge scons
If you need a specific
version of SCons that is different from the current version,
pip has a version option
python -m pip install scons==3.1.2),
or you can follow the instructions in the following sections.
SCons does comes pre-packaged for installation on many Linux systems. Check your package installation system to see if there is an up-to-date SCons package available. Many people prefer to install distribution-native packages if available, as they provide a central point for management and updating; however not all distributions update in a timely fashion. During the still-ongoing Python 2 to 3 transition, some distributions may still have two SCons packages available, one which uses Python 2 and one which uses Python 3. Since the latest scons only runs on Python 3, to get the current version you should choose the Python 3 package.