Disable ipython autoload virtual environment
<p>I have two different python virtual environment systems, one is <code>anaconda</code> and the other is <code>virtualenv</code>. (I need to keep both to suit different develop environment).</p>

<p>I installed separate ipython for each virtual env. The problem is that ipython seems to be virtual environment aware, it will automatically load libs from <code>$VIRTUAL_ENV</code>.</p>

<p>For example, here are my two different virtual environments</p>

<ol>
<li><code>venv</code>, created by <code>virtualenv</code>: <code>virtualenv /home/&lt;user&gt;/venv</code>.
And I set <code>$VIRTUAL_ENV</code> by adding <code>export VIRTUAL_ENV='/home/shao/venv'</code> in <code>.bashrc</code>. Also I installed some required package in this environment by <code>pip</code> </li>
<li><code>p2</code>, created by <code>anaconda</code>: <code>conda create -n p2 python=2</code>.</li>
</ol>

<p>The <code>$PATH</code> after activating <code>p2</code> is:</p>

<pre><code>(p2) shao@T420s:~$ echo $PATH
/home/shao/anaconda3/envs/p2/bin:/home/shao/anaconda3/bin:/home...
</code></pre>

<p>I am definitely sure that <code>ipython</code> binaray is at <code>/home/shao/anaconda3/envs/p2/bin</code>. </p>

<p>However, the ipython <code>sys.path</code> for p2 is:</p>

<pre><code>(p2) shao@T420s:~$ ipython
/home/shao/anaconda3/envs/p2/lib/python2.7/site-packages/IPython/core/interactiveshell.py:724: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
  warn("Attempting to work in a virtualenv. If you encounter problems, please "
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:42:40) 
Type "copyright", "credits" or "license" for more information.

...

In [1]: import sys
In [2]: sys.path
Out[2]: 
['/home/shao/venv/lib/python2.7/site-packages/pandas-0.18.1-py2.7-linux-x86_64.egg',
 '/home/shao/venv/lib/python2.7/site-packages/tika-1.13.1-py2.7.egg',
 '/home/shao/venv/lib/python2.7/site-packages/superlance-0.11-py2.7.egg',
 '/home/shao/venv/lib/python2.7/site-packages/pytz-2016.6.1-py2.7.egg',
 ...
 '/home/shao/venv,
 '/home/shao/anaconda3/envs/p2/bin',
 '/home/shao/anaconda3/envs/p2/lib/python27.zip',
 ...
 '/home/shao/.ipython']
</code></pre>

<p>As you can see, ipython interpreter gives me warnings and the <code>sys.path</code> contains libs from <code>venv</code>, which are prior libs from <code>p2</code>.</p>

<p>After some google searches, I noticed that recent ipython version is virtual environment <a href="https://stackoverflow.com/questions/20327621/calling-ipython-from-a-virtualenv">aware</a>, so that it will automatically load these libs from <code>venv</code>.</p>

<p>I noticed two things:</p>

<ol>
<li>python interpreter of <code>p2</code> will not be affected by <code>venv</code></li>
<li>If I RESET <code>$VIRTUAL_ENV</code>, ipython interpreter of <code>p2</code> will not be affected by <code>venv</code>.</li>
</ol>

<p>Now the question is that is there any graceful way (keep <code>$VIRTUAL_ENV</code>)  to disable ipython's initialization behavior, so that <code>$VIRTUAL_ENV</code> libs will not be loaded?</p>

<p>Thanks.</p>