jupyter notebook(Conda) 中的冲突 python 版本

Conflicting python version in jupyter notebook(Conda)

我正在尝试使用 Conda 设置 Jupyter notebook,但 notebook 使用的 python 版本与 Conda 环境不同。

我使用以下命令创建了 'python_jupyter' 环境。

conda create -n python_jupyter python=3.6.5 ipykernel

但是在 notebook 中,当我检查 python 版本时,我会根据检查方式得到不同的结果。如果我使用 bash 命令进行检查,我会得到预期的版本号 3.6.5,但是从 python 代码中,我会得到 3.6.3(我猜这是默认的 Conda 安装附带的)。

回到'base'(默认)环境,版本冲突解决,

为什么第一张图片有python版本冲突,如何解决?

编辑

当我在 运行 'conda info' 命令行上 'python_jupyter' 环境处于活动状态时,我看到 python 版本被报告为 3.6.3。但是如果我 运行 'python -V' 我看到 python 版本 3.6.5。为什么会有这种差异?此外,当我尝试使用 'conda update python' 更新 python 时,它不会提示我进行更新,这意味着 conda 认为我使用的是最新的 python 版本 3.6.5.

在我的 python_jupyter 环境中 运行ning conda install ipython jupyter 解决了这个问题。由于我可以使用默认安装 运行 jupyter notebook 命令,因此我假设 jupyter notebook 安装已完成。

conda info报告基础环境中Python的版本,conda listconda list -f pythonpython -V报告[=26=的版本] 在当前活动环境中,在本例中为 python_jupyter。 Source