如何知道 Jupyter notebook 中运行的是哪个 Python? [英] How to know which Python is running in Jupyter notebook?
本文介绍了如何知道 Jupyter notebook 中运行的是哪个 Python?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在浏览器中使用 Jupyter notebook 进行 Python 编程,我已经安装了 Anaconda (Python 3.5).但我很确定 Jupyter 正在使用本机 python 解释器而不是 anaconda 运行我的 python 命令.如何更改它并使用 Anaconda 作为解释器?
I use Jupyter notebook in a browser for Python programming, I have installed Anaconda (Python 3.5). But I'm quite sure that Jupyter is running my python commands with the native python interpreter and not with anaconda. How can I change it and use Anaconda as interpreter?
推荐答案
from platform import python_version
print(python_version())
这将为您提供运行脚本的确切版本的 python.例如输出:
This will give you the exact version of python running your script. eg output:
3.6.5
这篇关于如何知道 Jupyter notebook 中运行的是哪个 Python?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文