I believe that IPYTHONDIR get set, so this won't be the ~/.ipython/profile_default, but /tmp/soma_random_dir/.ipython/profile_default.