Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
184 views
in Technique[技术] by (71.8m points)

Python path is different between VS Code terminal and default terminal

I use conda in both MacOS default terminal and VS Code integrated terminal, but they use different Python, it's really strange and I don't know how to keep them same.

VS Code terminal:

Documents/GitHub/self-study  master ?                                                                                                     23h17m ?  
? conda env list
# conda environments:
#
base                  *  /Users/wsx/Library/r-miniconda
d2l                      /Users/wsx/Library/r-miniconda/envs/d2l
r-reticulate             /Users/wsx/Library/r-miniconda/envs/r-reticulate
sigminer_sigprofiler     /Users/wsx/Library/r-miniconda/envs/sigminer_sigprofiler

(base) 
Documents/GitHub/self-study  master ?                                                                                                     23h17m ?  
? which python
/usr/bin/python
(base) 
Documents/GitHub/self-study  master ?                                                                                                     23h18m ?  
? which python3
/usr/local/bin/python3
Documents/GitHub/self-study  master ?                                                                                                     23h18m ?  
? echo $SHELL
/bin/zsh

MacOS default terminal:

? conda env list
# conda environments:
#
base                  *  /Users/wsx/Library/r-miniconda
d2l                      /Users/wsx/Library/r-miniconda/envs/d2l
r-reticulate             /Users/wsx/Library/r-miniconda/envs/r-reticulate
sigminer_sigprofiler     /Users/wsx/Library/r-miniconda/envs/sigminer_sigprofiler

(base) 
~                                                                                                                      
? which python
/Users/wsx/Library/r-miniconda/bin/python
(base) 
~                                                                                                                      
? which python3
/Users/wsx/Library/r-miniconda/bin/python3
? echo $SHELL
/bin/zsh
question from:https://stackoverflow.com/questions/65940767/python-path-is-different-between-vs-code-terminal-and-default-terminal

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You could check what's the value of this key in your settings.json file

"python.defaultInterpreterPath": "path-used-by-vscode"

You can check this post too.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...