In general: Avoid /usr/bin
on current MacOS (where it's read-only)
/usr/bin
isn't writable on new versions of MacOS, even as root, unless System Integrity Protection has been disabled. Consider:
sudo python setup.py install --prefix=/usr/local
Another option, which doesn't require sudo
at all, is to use a virtualenv:
virtualenv ~/pyobfuscate.venv ## create a virtualenv
. ~/pyobfuscate.venv/bin/activate ## activate that virtualenv
python setup.py install ## install pyobfuscate in that virtualenv
...and thereafter, . ~/pyobfuscate.venv/bin/activate
in a given shell before running pyobfuscate
in that shell.
But pyobfuscate's setup.py
needs to be fixed before you can do that:
That said, current versions of pyobfuscate have their setup.py
written as follows:
data_files=[('/usr/bin', ['pyobfuscate'])]
That's inappropriate, and instead, should be:
scripts=['pyobfuscate']
...which will follow the prefix given, whether via a virtualenv or a --prefix=
argument.