[英]How to specify python3 kernel in jupyter in pyCharm?
您显示的首选项图像确实是如何为PyCharm设置解释器的,但这不是PyCharm的输出/日志记录的样子。 我猜这是一个jupyter-notebook显示器,这意味着你在jupyter-notebook而不是PyCharm中遇到了问题。 因此,您需要更改jupyter的设置。 基于一些快速搜索pip install jupyter
将安装一个python 2.7版本的jupyter。 听起来像你想要的是
pip3 install jupyter
这将为您安装python3版本。 您可能必须卸载当前版本的jupyter。
当您从PyCharm中启动Jupyter-notebook时,会创建一个配置。 如果配置最初是2.7(我认为它默认为当前解释器),然后继续使用相同的配置,那么当前项目解释器的状态无关紧要,因为它将使用运行配置中保存的值。
您可以通过修改运行配置
Run | Run...
Edit Configurations...
Select your Jupyter Notebook run configuration on the left
(此处为无标题4)
Make sure the python interpreter is correct here on the right
我能够像这样启动一个jupyter笔记本并通过这样做来输出python 3。 希望这是你需要的。
我的问题是我有多个内核,PyCharm启动默认内核。 一种方法可能是配置PyCharm来指定启动的选择内核,我没有调查如何做到这一点。 我只是更改了Jupyter中的默认内核,这对我有用(我有一个针对tensorflow的virtualenv)。 c.MultiKernelManager.default_kernel_name = 'tensorflow'
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.