If executing:
python setup.py install
give you error like:
[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) -- Some packages may not be found!
it may be caused by outdate OpenSSL. But if after executing:
python -c "import ssl; print(ssl.OPENSSL_VERSION)"
you see something like:
OpenSSL 1.0.2n 7 Dec 2017
then your SSL is pretty good. What to do then?

1. If you are in Virtual Env mode, deactivate it
2. Remove your Virtual Env
3. Run “brew update”
4. Run “brew install openssl” just in case
5. Run “brew install python3”

Next thing is check available python versions which you can use in venv:
ls /Library/Frameworks/Python.framework/Versions/
If you will see only “3.5”, go to python.org and download newest MacOs package (currently 3.6.5) then install as usual.
After installing make you that:
ls /Library/Frameworks/Python.framework/Versions/
will show:
3.5 3.6

Now you can create new Virtual Env with forced python 3.6:
virtualenv envname --python=python3.6

Now installing packages should work.

During configuration of Magento 1.7.0.2 (in fact whole 1.7.x branch) you may encounter such error:

Database server does not support InnoDB storage engine

Of course your MySQL server has InnoDB enabled so what to do? Answer is simple but ugly, go to app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php and replace:

with