繁体   English   中英

Intellij的想法没有正确运行IPython笔记本

[英]Intellij idea does not run IPython notebook properly

我在Windows 8中安装了带有python 2.7.10的conda,安装了ipython notebook和jupyter。 当我尝试从控制台运行ipython笔记本时? 它运行正常。 但是从intellij的想法我收到一个错误,就像它没有看到笔记本分期付款:

path \\ to \\ python \\ Miniconda3 \\ envs \\ py27 \\ python.exe path \\ to.IntelliJIdea14 \\ config \\ plugins \\ python \\ helpers \\ pycharm \\ pycharm_load_entry_point.py notebook --no-browser --ip 127.0.0.1 --port 8888

回溯(最近一次调用最后一次):文件“path \\ to.IntelliJIdea14 \\ config \\ plugins \\ python \\ helpers \\ pycharm \\ pycharm_load_entry_point.py”,第8行,在load_entry_point(dist,“console_scripts”,name)()

在load_entry_point中输入文件“path \\ topython \\ Miniconda3 \\ envs \\ py27 \\ lib \\ site-packages \\ setuptools-18.3.2-py2.7.egg \\ pkg_resources__init __。py”,第558行
文件“path \\ topython \\ Miniconda3 \\ envs \\ py27 \\ lib \\ site-packages \\ setuptools-18.3.2-py2.7.egg \\ pkg_resources__init __。py”,第2681行,在load_entry_point中ImportError:入口点('console_scripts','找不到ipython')

我试图让它工作几次,控制台和ide同时进行,并且曾经一次在ide中运行,但是在成功关闭后它不再运行。 可能有什么问题?

在path \\ to \\ python \\ Miniconda3 \\ envs \\ py27中的环境中的#包:

jupyter-client 4.0.0

jupyter-core 4.0.6

jupyter_client 4.0.0 py27_0

jupyter_core 4.0.6 py27_0

[py27] conda list ipython

在path \\ to \\ python \\ Miniconda3 \\ envs \\ py27的环境中的#包:#

ipython 4.0.0 py27_0

ipython-genutils 0.1.0

ipython-notebook 4.0.4 py27_0

ipython-qtconsole 4.0.1 py27_0

ipython_genutils 0.1.0 py27_0

jupyter安装会有问题吗?

据我所知,这是Intellij IDEA的问题,而不是Jupyter的问题。

我使用安装了Jupyter笔记本的Anaconda与Intellij IDEA 14.1.5完全相同的问题。 然而,当我尝试在pyCharm中启动Ipython Notebook时,它运行正常(虽然我不得不降级到Ipython 3.2.1,但这是一个完全不相关的问题,只要提到它就会发生这种情况)。

至于解决方案:

只需使用以下代码替换{config_dir} .IntelliJIdea14 \\ config \\ plugins \\ python \\ helpers \\ pycharm \\ pycharm_load_entry_point.py的内容:

import os, sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
  dist = os.environ.get("PYCHARM_EP_DIST")
  name = os.environ.get("PYCHARM_EP_NAME")
  if dist == "ipython" and name == "ipython":
    from IPython import start_ipython
    f = start_ipython
  else:
    f = load_entry_point(dist, "console_scripts", name)
  sys.exit(f())

我在github上偶然发现了这个黑客攻击。 不确定您是否可以依赖它,它可能会被未来的更新覆盖。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM