Here is my setting and this is my script
这是我的设置,这是我的脚本。
I am trying to use jupyter notebook in pyCharm, but it kept using python2 instead of python3.
我试着在pyCharm中使用jupyter笔记本,但它一直使用python2而不是python3。
Add:
添加:
this pic is running jupyter notebook in chrome.
这张照片是在chrome上运行jupyter笔记本电脑。
0
The preferences image you show is indeed how you would setup your interpreter for PyCharm, but that's not what the output/logging of PyCharm looks like. I'm guessing that's a jupyter-notebook display, which means you are running into the issue in jupyter-notebook and not PyCharm. So you need to change your setup for jupyter. Based on some quick searching pip install jupyter
will install a python 2.7 version of jupyter. Sounds like what you want is
您所显示的首选项映像实际上是如何为PyCharm设置解释器的,但这并不是PyCharm的输出/日志记录的样子。我猜这是一个jupyter-笔记本电脑的展示,这意味着你将在jupyter-notebook中遇到这个问题,而不是PyCharm。所以你需要改变你的设置。基于快速搜索的pip安装,jupyter将安装python 2.7版本的jupyter。听起来你想要的是。
pip3 install jupyter
pip3安装jupyter
which will install the python3 version for you. You will likely have to uninstall your current version of jupyter.
这将为您安装python3版本。您可能需要卸载当前版本的jupyter。
0
When you kick off Jupyter-notebook from within PyCharm there is a configuration which is created. If the configuration is initially 2.7 ( I think it defaults to the current interpreter), and then keep using that same configuration, it wouldn't matter the state of the current project interpreter because it would be using the value saved in the run configuration.
当你从PyCharm中启动Jupyter-notebook时,会产生一个配置。如果配置最初是2.7(我认为它默认为当前解释器),然后继续使用相同的配置,那么当前项目解释器的状态就不重要了,因为它将使用在运行配置中保存的值。
You can modify your run configuration by
您可以修改您的运行配置。
Run | Run...
Edit Configurations...
Select your Jupyter Notebook run configuration on the left
(here is untitled4)
在左边选择您的Jupyter笔记本运行配置(这里是untitled4)
Make sure the python interpreter is correct here on the right
确保python解释器在右边这里是正确的。
I was able to start a jupyter notebook like this and get it to output python 3 by doing this. Hope this is what you are needing.
我可以像这样启动一个jupyter笔记本,然后通过这样做,让它输出python 3。希望这是你所需要的。
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2017/07/04/d343bed6f70b0b92f6dc008f61417c45.html。