I am trying to install Python 3.5.1 according to these instructions:
http://thomas-cokelaer.info/blog/2014/08/installing-another-python-version-into-virtualenv/
It gives you an error because it misses OpenSSL. However Apple no longer provides OpenSSL in Xcode, so you need to manually install. The simplest approach is to use the Homebrew package manager, install the required package, and then include the OpenSSL libs:
export CPPFLAGS="${CPPFLAGS} -I$(brew --prefix openssl)/include"
export LDFLAGS="${LDFLAGS} -L$(brew --prefix openssl)/lib"