How does one get emacs to use the same PATH to the python and pdb executables as I get from the term when I have set a specific miniconda environment?
Ie in emacs, when I run Mx pdb
, I would like it to use the same executable as I do if I have done the following from the term:
$ source activate my_py3_env
$ pdb
I know currently this isn't what is happening. I switch to a python 3 env, which modifies my PATH appropriately, but when I run Mx pdb
for a python script and print sys.version from within that script I get:
2.7.17 |Anaconda, Inc.| (default, Oct 21 2019, 19:04:46)
So it seems to be picking up the 'base' miniconda env which is still 2.7
I would half of expected it to pick up whats in /usr/bin but that doesn't seem to be the case, ie if I execute:
$ /usr/bin/python
I get
Python 2.7.15+ (default, Oct 7 2019, 17:39:04)
To summarise, is there a way to get emacs Mx pdb
to 'follow' the conda environment I am currently in without me having to manually specify the location of the pdb executable for each environment?
You can find the conda
or virtualenv python path with (swap in the analogous conda equivalent for starting the env): source .py2james/bin/activate
and which python
in the terminal. Note the path to the python exe.
you can do: option + x pdb
then: /Users/janderson/code/python/awsomeapp/.py2james/bin/python -m pdb main.py
and the emacs pdb debugger will start.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.