为什么我的代码不会在ipython笔记本上执行?

时间:2016-06-23 08:09:57

标签: python command-line ipython ipython-notebook jupyter-notebook

我是jupyter笔记本的新手,我试图运行一个简单的代码而不能正常工作。enter image description here

我键入了print(1)并点击了ctrl + enter,然后出现了星号标记,这就是它。控制台中也有一个闪烁的“连接”。

命令窗口如下所示: enter image description here

任何关于此的提示都将受到高度赞赏。谢谢

3 个答案:

答案 0 :(得分:5)

是的,因为Teemo指出我所要做的就是使用它,

C:\ Python27 \ Scripts> jupyter notebook --port = 8889

代替,

C:\ Python27 \ Scripts> jupyter notebook。

端口8889,就像一个魅力:)

答案 1 :(得分:3)

在VM上使用Jupyter,这对我来说也是解决方案。此外,您可以使用以下命令创建配置文件:

jupyter notebook --generate-config

并在jupyter_notebook_config.py文件中搜索c.NotebookApp.port = 8888(并将端口更改为8889)

所以每次调用jupyter时都不必手动添加端口。

答案 2 :(得分:1)

我遇到了同样的问题,更改主机端口并不能解决任何问题。我终于不得不卸载jupyter网络软件包。我通过“ pip install”安装得很好,我建议也使用conda将其卸载,并仅通过以下内容重新安装它:

conda uninstall jupyter notebook 
pip uninstall jupyter 
pip3 uninstall jupyter
conda install jupyter notebook