如何找到 Python 解释器
原文 How to find the Python interpreter
Played the detective game for a while. [Python Environment Manager](https://marketplace.visualstudio.com/items?itemName=donjayamanne.python-environment-manager) is a VSCode extension manages Python environments and packages in a handy fashion.The answer is that I assumed the conda env creation includes a clean Python installation itself, which is not true.
If you don’t specify “you really need Python here” when creating a new condo env, it won’t have any default python interpreter ready. For example, in Jupyter notebook, you probably won’t find the kernel from that newly created env.
In short, do
conda create --name newenv python=3.10
or simpler:
conda create --name newenv python
but never:
conda create --name newenv
以下为 GPT-4o 翻译内容:
玩了一会儿侦探游戏。Python环境管理器是一个VSCode扩展,可以方便地管理Python环境和包。
答案是我假设conda环境的创建本身包含一个干净的Python安装,但事实并非如此。
如果在创建新的conda环境时没有指定“这里确实需要Python”,那么它将没有任何默认的Python解释器。例如,在Jupyter notebook中,你可能找不到从那个新创建的环境中来的内核。
简而言之,执行
conda create --name newenv python=3.10
或者更简单:
conda create --name newenv python
但绝不要:
conda create --name newenv