【问题标题】:IPython Notebook (Jupyter) Bash Kernel raising FileNotFoundError with Python3IPython Notebook (Jupyter) Bash 内核使用 Python3 引发 FileNotFoundError
【发布时间】:2015-04-21 10:45:24
【问题描述】:

最近升级到 Anaconda Python3 但现在当我尝试使用 bash 内核启动新笔记本时,我得到以下回溯,表明它仍在寻找我以前的 python 解释器。不确定如何将其更新为指向我在 anaconda3 文件夹中的新 python。任何帮助,将不胜感激。

[E 10:40:58.086 NotebookApp] Unhandled error in API request
        Traceback (most recent call last):
          File "/ebs/anaconda3/lib/python3.4/site-packages/IPython/html/base/handlers.py", line 365, in wrapper
            result = yield gen.maybe_future(method(self, *args, **kwargs))
          File "/ebs/anaconda3/lib/python3.4/site-packages/IPython/html/services/sessions/handlers.py", line 53, in post
            model = sm.create_session(path=path, kernel_name=kernel_name)
          File "/ebs/anaconda3/lib/python3.4/site-packages/IPython/html/services/sessions/sessionmanager.py", line 66, in create_session
            kernel_name=kernel_name)
          File "/ebs/anaconda3/lib/python3.4/site-packages/IPython/html/services/kernels/kernelmanager.py", line 84, in start_kernel
            kernel_name=kernel_name, **kwargs)
          File "/ebs/anaconda3/lib/python3.4/site-packages/IPython/kernel/multikernelmanager.py", line 112, in start_kernel
            km.start_kernel(**kwargs)
          File "/ebs/anaconda3/lib/python3.4/site-packages/IPython/kernel/manager.py", line 240, in start_kernel
            **kw)
          File "/ebs/anaconda3/lib/python3.4/site-packages/IPython/kernel/manager.py", line 189, in _launch_kernel
            return launch_kernel(kernel_cmd, **kw)
          File "/ebs/anaconda3/lib/python3.4/site-packages/IPython/kernel/launcher.py", line 213, in launch_kernel
            proc = Popen(cmd, **kwargs)
          File "/ebs/anaconda3/lib/python3.4/subprocess.py", line 859, in __init__
            restore_signals, start_new_session)
          File "/ebs/anaconda3/lib/python3.4/subprocess.py", line 1457, in _execute_child
            raise child_exception_type(errno_num, err_msg)
        FileNotFoundError: [Errno 2] No such file or directory: '/root/anaconda/bin/python'

【问题讨论】:

    标签: ipython ipython-notebook jupyter


    【解决方案1】:

    使用符号链接来实现:

    ln -s /path/to/old/binary /path/to/new/binary

    如果您收到权限不足错误,请在命令前添加 sudo

    在您的情况下,您应该将 /root/anaconda/bin/python 符号链接到您的 anaconda 文件夹中的二进制文件。

    【讨论】:

      猜你喜欢
      • 2021-03-25
      • 2017-05-18
      • 2015-05-04
      • 2021-05-21
      • 2020-01-31
      • 2020-07-15
      • 1970-01-01
      • 2016-05-14
      相关资源
      最近更新 更多