簡體   English   中英

Anaconda錯誤啟動python 3 jupyter筆記本

[英]Anaconda error launching python 3 jupyter notebook

安裝Anaconda3.5后,嘗試使用jupyter打開python 3筆記本時出現錯誤。 python 2筆記本沒有問題。 這是錯誤

Failed to run command:
    ['/Users/sushmitroy/anaconda/envs/py35/bin/python', '-m', 'ipykernel', '-f', '/Users/sushmitroy/Library/Jupyter/runtime/kernel-64704aa3-3d05-4249-8ec2-8a9c98659538.json']
    with kwargs:
    {'stderr': None, 'cwd': '/Users/sushmitroy', 'stdin': -1, 'env': {'HOME': '/Users/sushmitroy', 'LOGNAME': 'sushmitroy', 'PWD': '/Users/sushmitroy', 'TERM': 'xterm-256color', 'SECURITYSESSIONID': '186a8', 'Apple_PubSub_Socket_Render': '/private/tmp/com.apple.launchd.EDDWkpkF2z/Render', 'XPC_SERVICE_NAME': '0', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'XPC_FLAGS': '0x0', 'SHELL': '/bin/bash', 'JPY_PARENT_PID': '5519', 'TERM_SESSION_ID': '28DC0BD0-4ED2-4C96-B2D9-1375A8C804D8', 'LANG': 'en_US.UTF-8', 'TMPDIR': '/var/folders/bj/2h_6v_sd7rn4_4hvy91gy_rm0000gn/T/', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.vrnAzalULu/Listeners', 'TERM_PROGRAM_VERSION': '361.1', '_': '/Users/sushmitroy/anaconda/bin/jupyter-notebook', 'USER': 'sushmitroy', 'TERM_PROGRAM': 'Apple_Terminal', 'SHLVL': '2', 'PATH': '/Users/sushmitroy/anaconda/bin:/Users/sushmitroy/anaconda/bin:/Users/sushmitroy/anaconda/bin:/Users/sushmitroy/anaconda/bin://anaconda/bin:/Users/sushmitroy/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'}, 'stdout': None, 'start_new_session': True}

[E 01:25:15.946 NotebookApp] Unhandled error in API request
    Traceback (most recent call last):
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/notebook/base/handlers.py", line 457, in wrapper
        result = yield gen.maybe_future(method(self, *args, **kwargs))
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/gen.py", line 1008, in run
        value = future.result()
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/concurrent.py", line 232, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 3, in raise_exc_info
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/gen.py", line 1014, in run
        yielded = self.gen.throw(*exc_info)
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/notebook/services/sessions/handlers.py", line 62, in post
        kernel_id=kernel_id))
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/gen.py", line 1008, in run
        value = future.result()
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/concurrent.py", line 232, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 3, in raise_exc_info
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/gen.py", line 1014, in run
        yielded = self.gen.throw(*exc_info)
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
        kernel_name)
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/gen.py", line 1008, in run
        value = future.result()
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/concurrent.py", line 232, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 3, in raise_exc_info
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/gen.py", line 1014, in run
        yielded = self.gen.throw(*exc_info)
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/notebook/services/sessions/sessionmanager.py", line 92, in start_kernel_for_session
        self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/gen.py", line 1008, in run
        value = future.result()
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/concurrent.py", line 232, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 3, in raise_exc_info
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/tornado/gen.py", line 282, in wrapper
        yielded = next(result)
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/notebook/services/kernels/kernelmanager.py", line 87, in start_kernel
        super(MappingKernelManager, self).start_kernel(**kwargs)
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
        km.start_kernel(**kwargs)
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/jupyter_client/manager.py", line 243, in start_kernel
        **kw)
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/jupyter_client/manager.py", line 189, in _launch_kernel
        return launch_kernel(kernel_cmd, **kw)
      File "/Users/sushmitroy/anaconda/lib/python3.5/site-packages/jupyter_client/launcher.py", line 123, in launch_kernel
        proc = Popen(cmd, **kwargs)
      File "/Users/sushmitroy/anaconda/lib/python3.5/subprocess.py", line 950, in __init__
        restore_signals, start_new_session)
      File "/Users/sushmitroy/anaconda/lib/python3.5/subprocess.py", line 1544, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: '/Users/sushmitroy/anaconda/envs/py35/bin/python'
[E 01:25:15.954 NotebookApp] {
      "Accept-Encoding": "gzip, deflate",
      "Accept-Language": "en-US,en;q=0.8",
      "Accept": "application/json, text/javascript, */*; q=0.01",
      "Content-Type": "application/json",
      "Host": "localhost:8888",
      "X-Requested-With": "XMLHttpRequest",
      "Content-Length": "76",
      "Connection": "keep-alive",
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36",
      "Origin": "http://localhost:8888",
      "Referer": "http://localhost:8888/notebooks/Untitled.ipynb?kernel_name=python3"
    }
[E 01:25:15.955 NotebookApp] 500 POST /api/sessions (::1) 51.32ms referer=http://localhost:8888/notebooks/Untitled.ipynb?kernel_name=python3

python -m IPython kernelspec install-self

做到了

鏈接在這里

https://github.com/jupyter/notebook/issues/300

如果您是使用conda環境安裝python3的,則可以這樣訪問它:

$ source activate <env name>
$ jupyter notebook

您可以像這樣還原到根目錄:

$ source deactivate

如果您安裝了anaconda的新實例,最好通過以下方式卸載它並重新安裝它:

$ conda create -n py35 python=3.5 anaconda

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM