Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>python-shell</code> uses variable <code>python-default-interpreter</code> to determine which python interpreter to use. When the value of this variable is <code>cpython</code>, the variables <code>python-python-command</code> and <code>python-python-command-args</code> are consulted to determine the interpreter and arguments to use. Those two variables are manipulated by <code>virtualenv.el</code> to set the current virtual environment.</p> <p>So when you use <code>python-shell</code> command, it uses your virtual environments without any problem.</p> <p>But, when you do <kbd>M-!</kbd> <code>python</code>, you're not using the variables <code>python-python-command</code> and <code>python-python-command-args</code>. So it uses the python tools it finds in your path.</p> <p>When you call <kbd>M-x</kbd> <code>pdb</code> it uses gud-pdb-command-name as the default pdb tool. To redefine this variable, each time you activate an environment, you could do something like this :</p> <pre><code>(defadvice virtualenv-activate (after virtual-pdb) (custom-set-variables '(gud-pdb-command-name (concat virtualenv-active "/bin/pdb" )))) (ad-activate 'virtualenv-activate) </code></pre> <p>To have pdb in your virtual environment, do the following :</p> <pre><code>cp /usr/bin/pdb /path/to/virtual/env/bin </code></pre> <p>Then edit the first line of /path/to/virtual/env/bin/pdb to have :</p> <pre><code>#! /usr/bin/env python </code></pre> <p>Reactivate your env and Pdb should now use your virtualenv python instead of the system-wide python.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload