title: how to pip install a package under conda virtual env
body: <p>I need to install mpl_finance under a conda virtual environment, this package is not available via conda, only pip can install. I have tried below, does not work out, please advice.</p>
  
  <p>I first set up a virtual env called cs231p under <code>user/miniconda3/envs/cs231p</code>.
  I cd to user/miniconda3/envs/cs231p/bin, and activated the env</p>
  
  <pre><code>conda activate cs231p
  </code></pre>
  
  <p>Then I do: conda list to make sure pip is there:</p>
  
  <pre><code>    ca-certificates           2019.1.23                     0  
      certifi                   2019.3.9                 py37_0  
      libcxx                    4.0.1                hcfea43d_1  
      libcxxabi                 4.0.1                hcfea43d_1  
      libedit                   3.1.20181209         hb402a30_0  
      libffi                    3.2.1                h475c297_4  
      ncurses                   6.1                  h0a44026_1  
      openssl                   1.1.1b               h1de35cc_1  
      pip                       19.0.3                   py37_0  
  </code></pre>
  
  <p>Then I do:</p>
  
  <pre><code>which pip
  </code></pre>
  
  <p>shows</p>
  
  <pre><code> /miniconda3/envs/cs231p/bin/pip
  </code></pre>
  
  <p><code>(cs231p) bin$ pip install mpl_finance</code></p>
  
  <p>I got error: but the path of pip is not from the virtual env that I set up.</p>
  
  <blockquote>
    <p>XXX/anaconda/bin/python3.5: can't open file 'install': [Errno 2] No such file or directory</p>
  </blockquote>
  
  <pre><code>python -m pip install mpl_finance
  </code></pre>
  
  <p>gives </p>
  
  <blockquote>
    <p>requirement already satisfied:mpl_finance in
    ~/anaconda/lib/python3.5/site-packages (0.10.0)</p>
  </blockquote>