From 57d3e84411f420c7a215d45cd68cdf0f4c5bf242 2013-11-04 22:41:15 From: Thomas Kluyver Date: 2013-11-04 22:41:15 Subject: [PATCH] Merge pull request #4489 from minrk/venv-realpath check realpath of env in init_virtualenv --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 31b1b2f..1b13c98 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -716,7 +716,9 @@ class InteractiveShell(SingletonConfigurable): # Not in a virtualenv return - if sys.executable.startswith(os.environ['VIRTUAL_ENV']): + if os.path.realpath(sys.executable).startswith( + os.path.realpath(os.environ['VIRTUAL_ENV']) + ): # Running properly in the virtualenv, don't need to do anything return