Test Failed… does not support .pth files

If you are doing a setup.py with specific directories

python setup.py install --prefix=/home/user1

If you are getting a PythonPath Error something like this.

TEST FAILED: /home/user1/lib/python3.7/site-packages/ does NOT support .pth files error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. 
The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /home/user1/lib/python3.7/site-packages/

and your PYTHONPATH environment variable currently contains:

You can solve like by putting in your .bashrc.

export PYTHONPATH="${PYTHONPATH}:/home/user1/lib/python3.7/site-packages/"
source ~/.bashrc

Installing SCons-3.1.2 with Intel Python Distribution

What is SCons?

SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software.

For more information, see https://scons.org/

Prerequisites

Python 3 Distribution. For this I used the Intel Python Distribution

Get the Source Code

git clone https://github.com/SCons/scons.git

Setup scons directory and run the setup script

cd $HOME/scons
/usr/local/intel/2020/intelpython3/bin/python setup.py install

Do note that the scons will write a site package at /usr/local/intel/2020/intelpython3/lib/python3.7/site-packages/SCons-3.9.9a993-py3.7.egg . You need to allow the necessary permission

Testing the package

cd /usr/local/scons
python runtest.py SCons/BuilderTests.py
1/1 (100.00%) /usr/local/intel/2020/intelpython3//bin/python SCons/BuilderTests.py
......................................
----------------------------------------------------------------------
Ran 38 tests in 0.096s
OK

References:

  1. SCons: A software construction tool
  2. SCons GitHub Site