There are a couple of ways to do this now.
1) PEX_PATH (preferred as of pex 1.0)
If you're invoking from a pex, you can use PEX_PATH to merge together multiple pex files into a single runtime environment. It would look something like this:
pex -o empty.pex # create pex file with no dependencies
pex ... -o mymodule.pex # create pex file with mymodule.main
pex flask boto psutil -o mydeps.pex # bundle up whatever other dependencies you may have
then you can do
PEX_PATH=mymodule.pex:mydeps.pex:... ./empty.pex
This launches the empty environment but then merges in all the dependencies from 'mymodule' and 'mydeps' and whichever other pex files you have. You can then 'import mymodule' and call mymodule.main. This of course means that you need to be launching your interpreter via a pex file, but that's usually not a bad idea anyway (unless you have no other options, e.g. when using a web/wsgi framework.)
2) bootstrap_pex_env
If you have the location to a pex file, you can activate the environment through some path hackery:
path_to_pex_file = '/usr/local/libexec/mymodule.pex'
sys.path.insert(0, os.path.join(path_to_pex_file, '.bootstrap'))
from _pex.pex_bootstrapper import bootstrap_pex_env
bootstrap_pex_env(path_to_pex_file)
import mymodule
mymodule.main()
Alternately if you have 'pex' installed in your environment, you can just do 'from pex.pex_bootstrapper import bootstrap_pex_env' and do the same thing, but then you need to ensure that the pex file was built with the pex from your environment, otherwise there may be incompatibilities.
Hope that helps,
brian