如何在ipython3 kernelspec中使用环境变量(NOT SET,USE)?

时间:2015-04-26 23:14:57

标签: ipython ipython-notebook

我有一个ipython3 kernel.json,我想让它与系统无关,所以它看起来像这样:

{
    "argv": [
         "$SPARK_HOME/bin/spark-submit",
         "--master", "$MASTER",
....

$ SPARK_HOME / bin / spark-submit指向初始化内核的shell脚本。但是当我尝试在IPy笔记本中切换到它时,我收到了以下错误,看起来像spark-submit没有找到:

[I 18:56:03.110 NotebookApp] Kernel shutdown: 3c814610-56ce-4121-86f0-b1f9425fc8b7
[E 18:56:03.127 NotebookApp] Unhandled error in API request
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/IPython/html/base/handlers.py", line 365, in wrapper
        result = yield gen.maybe_future(method(self, *args, **kwargs))
      File "/usr/local/lib/python2.7/dist-packages/IPython/html/services/sessions/handlers.py", line 53, in post
        model = sm.create_session(path=path, kernel_name=kernel_name)
      File "/usr/local/lib/python2.7/dist-packages/IPython/html/services/sessions/sessionmanager.py", line 66, in create_session
        kernel_name=kernel_name)
      File "/usr/local/lib/python2.7/dist-packages/IPython/html/services/kernels/kernelmanager.py", line 84, in start_kernel
        kernel_name=kernel_name, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/IPython/kernel/multikernelmanager.py", line 112, in start_kernel
        km.start_kernel(**kwargs)
      File "/usr/local/lib/python2.7/dist-packages/IPython/kernel/manager.py", line 240, in start_kernel
        **kw)
      File "/usr/local/lib/python2.7/dist-packages/IPython/kernel/manager.py", line 189, in _launch_kernel
        return launch_kernel(kernel_cmd, **kw)
      File "/usr/local/lib/python2.7/dist-packages/IPython/kernel/launcher.py", line 213, in launch_kernel
        proc = Popen(cmd, **kwargs)
      File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
        errread, errwrite)
      File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
        raise child_exception
    OSError: [Errno 2] No such file or directory
[E 18:56:03.129 NotebookApp] {
      "Origin": "http://localhost:8888", 
      "Content-Length": "76", 
      "Accept-Language": "en-CA,en;q=0.8,zh-TW;q=0.6,zh;q=0.4,zh-CN;q=0.2", 
      "Accept-Encoding": "gzip, deflate", 
      "Connection": "keep-alive", 
      "Accept": "application/json, text/javascript, */*; q=0.01", 
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36", 
      "Host": "localhost:8888", 
      "X-Requested-With": "XMLHttpRequest", 
      "Referer": "http://localhost:8888/notebooks/Untitled0.ipynb", 
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
    }
[E 18:56:03.129 NotebookApp] 500 POST /api/sessions (127.0.0.1) 11.81ms referer=http://localhost:8888/notebooks/Untitled0.ipynb

kernel.json中不支持美元符号吗?如果是真的,我该如何解决?

非常感谢您的帮助。

0 个答案:

没有答案
相关问题