问题
The question:
This post explains how to change which Python installation to run in Spyder under Tools > Preferences > Python Interpreter
. One of the options is Default (i.e. same as Spyder's)
:
But how do you find out what that is?
Some details:
I'm trying to help a colleague run a Python script using a batch file. The script runs just fine from Spyder. But when I'm setting up the batch file, I'm getting the error error importing module Seaborn
. So I'm clearly able to run Python (the only python.exe I've found on the system) with the batch setup, but the importing error makes me think that there are more Python installations on the system that I'm not able to detect for some reason, but is being used by Spyder since the very same script does not raise the same error when run from Spyder. I'm a bit confused here, so thank you for any suggestions!
回答1:
(Spyder maintainer here) To detect the interpreter run by our IPython consoles, you need to run the following code on any of them:
In [1]: import sys
In [2]: sys.executable
Out[2]: '/home/carlos/miniconda/envs/py36/bin/python'
来源:https://stackoverflow.com/questions/54234698/how-to-check-which-python-interpreter-spyder-is-running-on-its-console