Cannot access file in python "unsafe use of relative rpath"

On my mac this is the stock python. The following command will tell you where the python that is being executed lives:

which python
which python2

I believe that by default the system python comes first in the path and may be the reason that the homebrew version is not being evoked. This will list the search paths for binaries:

printenv PATH

This will let you locate all the files named python on the system, one will be the system python and one will be homebrew:

locate */python

This is typically much slower, but may be more exact:

find / -type f -name "python" 2>/dev/null