【问题标题】:How to change Python version in Jupyter notebook?如何在 Jupyter 笔记本中更改 Python 版本?
【发布时间】:2021-01-05 09:27:21
【问题描述】:

一开始我安装了最新的 Python 3.9 版本。但是,在这个版本上我无法安装 tensorflow,我读到的它不支持这个版本。之后,我安装了 Python 3.8.7,但我的 jupyter notebook 仍在使用 Python 3.9。如何更改 Jupyter Notebook 中的版本以使用 3.8.7 而不是 3.9?提前致谢。

【问题讨论】:

  • 你是如何安装 python 3.8 的?使用像 conda 这样的虚拟环境?
  • 不,我只是通过python网页上的普通安装程序安装的
  • 您是否在使用像 conda 这样的虚拟环境管理器?通过这种方式,您可以轻松地使用不同版本的 Python 创建环境。
  • 不,我正在使用 jupyter notebook,只需输入 cmd "jupyter notebook",我想知道如何在 notebook 中轻松切换此版本
  • 使用 virtualenv 并在其中启动 jupyter。例如。 pipenv run jupyter-notebook - 这样可以保证您从正确的 python 解释器和正确的库集开始。 poetry 也可以这样使用。

标签: python jupyter


【解决方案1】:
pip3 install ipykernel --upgrade
python3 -m ipykernel install --user

参考资料:

Jupyter Notebook can't find modules for python 3.6

【讨论】:

    猜你喜欢
    • 2018-08-20
    • 2020-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多