Notebook: After uninstalling Anaconda,FileNotFoundError: [Errno 2] No such file or directory: '/Users/domore/anaconda/bin/python'

Created on 5 Apr 2018  路  3Comments  路  Source: jupyter/notebook

Due to a host of other issues, I removed anaconda. However, Jupyter is still linked to the version of python in anaconda. So I uninstalled every jupyter/ipython related module and use "pip3 install jupyter."

I still encountered the same errors. I downgraded tornado since the new update doesn't work. (pip3 install tornado==4.5.3). Right now, all my packages are in "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages."

How to make Jupyter recognize that the Python I want to use is in "/Library/Frameworks/Python.framework/Versions/3.6/"?

[E 20:39:04.049 NotebookApp] Failed to run command:
    ['/Users/domore/anaconda/bin/python', '-m', 'ipykernel_launcher', '-f', '/Users/domore/Library/Jupyter/runtime/kernel-2fd35841-50b8-4885-be50-1aa62bf84ad0.json']
        PATH='/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/domore/miniconda3/bin:/Users/domore/anaconda/bin:/Users/domore/anaconda/bin:/Users/domore/.cargo/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands'
        with kwargs:
    {'stdin': -1, 'stdout': None, 'stderr': None, 'cwd': '/Users/domore/CarND-Term1-Starter-Kit/CNN-Traffic-Sign-Classifier', 'start_new_session': True}

[E 20:39:04.051 NotebookApp] Uncaught exception POST /api/sessions (::1)
    HTTPServerRequest(protocol='http', host='localhost:8891', method='POST', uri='/api/sessions', version='HTTP/1.1', remote_ip='::1', headers={'Host': 'localhost:8891', 'Connection': 'keep-alive', 'Content-Length': '106', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'Origin': 'http://localhost:8891', 'X-Requested-With': 'XMLHttpRequest', 'X-Xsrftoken': '2|6254cde7|77e6ee3eff0ad2598a1b1f78b5057c11|1520667464', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36', 'Content-Type': 'application/json', 'Referer': 'http://localhost:8891/notebooks/Traffic_Sign_Classifier.ipynb', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7', 'Cookie': '_xsrf=2|6254cde7|77e6ee3eff0ad2598a1b1f78b5057c11|1520667464; username-localhost-8888="2|1:0|10:1522880706|23:username-localhost-8888|44:MzE3ZDFmNmRmNTc3NDg2NWFkNmE3MTU1MGFkZmYxZWU=|53aade392a84de32fcd9d6c95b492b5e7ec06b5b794b291b1aa2e2f32eae865b"; username-localhost-8889="2|1:0|10:1522882481|23:username-localhost-8889|44:NTk5NTUwN2Y5MzcwNDQzNjhhZGUzNzM1YjRiODQxOTM=|ecabd63dfa6bc0fde16c153b89332c7172ed9263f314399b243d8dec1e94dafb"; username-localhost-8890="2|1:0|10:1522895135|23:username-localhost-8890|44:YWJjNWRlNjc2YTU1NGYyMmI0NGNhY2RlZjcwOTlkN2Y=|05c1fcee2647069d7ec7dfc875467bb8b0f5b0cd42b4d51c89ceb6d29bc3201b"; username-localhost-8892="2|1:0|10:1522898982|23:username-localhost-8892|44:MjU1YWM5MTVmYzEwNDMzMWJiNTJjYmEyYTJkNGQyOWM=|8f11b0860b57e527dbbe2f607cbf50c3afb795e29b63397f06ea65137e310f09"; username-localhost-8891="2|1:0|10:1522899527|23:username-localhost-8891|44:ZmNhYzdlYmU3MzQxNDBiZDlkNzhkYzA3ZGE0OTc5MTk=|d07ac1753ae5e4e4cb9146360f573b444db5cd612df4ee4a141c4cb423dc6137"'})
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/web.py", line 1512, in _execute
        result = yield result
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run
        value = future.result()
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 4, in raise_exc_info
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/gen.py", line 1063, in run
        yielded = self.gen.throw(*exc_info)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notebook/services/sessions/handlers.py", line 73, in post
        type=mtype))
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run
        value = future.result()
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 4, in raise_exc_info
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/gen.py", line 1063, in run
        yielded = self.gen.throw(*exc_info)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
        kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run
        value = future.result()
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 4, in raise_exc_info
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/gen.py", line 1063, in run
        yielded = self.gen.throw(*exc_info)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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 "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run
        value = future.result()
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 4, in raise_exc_info
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tornado/gen.py", line 307, in wrapper
        yielded = next(result)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notebook/services/kernels/kernelmanager.py", line 148, in start_kernel
        super(MappingKernelManager, self).start_kernel(**kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
        km.start_kernel(**kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jupyter_client/manager.py", line 259, in start_kernel
        **kw)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jupyter_client/manager.py", line 204, in _launch_kernel
        return launch_kernel(kernel_cmd, **kw)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jupyter_client/launcher.py", line 128, in launch_kernel
        proc = Popen(cmd, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 707, in __init__
        restore_signals, start_new_session)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1333, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: '/Users/domore/anaconda/bin/python'
[W 20:39:04.059 NotebookApp] Unhandled error
[E 20:39:04.060 NotebookApp] {
      "Host": "localhost:8891",
      "Connection": "keep-alive",
      "Content-Length": "106",
      "Accept": "application/json, text/javascript, */*; q=0.01",
      "Origin": "http://localhost:8891",
      "X-Requested-With": "XMLHttpRequest",
      "X-Xsrftoken": "2|6254cde7|77e6ee3eff0ad2598a1b1f78b5057c11|1520667464",
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
      "Content-Type": "application/json",
      "Referer": "http://localhost:8891/notebooks/Traffic_Sign_Classifier.ipynb",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept-Language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
      "Cookie": "_xsrf=2|6254cde7|77e6ee3eff0ad2598a1b1f78b5057c11|1520667464; username-localhost-8888=\"2|1:0|10:1522880706|23:username-localhost-8888|44:MzE3ZDFmNmRmNTc3NDg2NWFkNmE3MTU1MGFkZmYxZWU=|53aade392a84de32fcd9d6c95b492b5e7ec06b5b794b291b1aa2e2f32eae865b\"; username-localhost-8889=\"2|1:0|10:1522882481|23:username-localhost-8889|44:NTk5NTUwN2Y5MzcwNDQzNjhhZGUzNzM1YjRiODQxOTM=|ecabd63dfa6bc0fde16c153b89332c7172ed9263f314399b243d8dec1e94dafb\"; username-localhost-8890=\"2|1:0|10:1522895135|23:username-localhost-8890|44:YWJjNWRlNjc2YTU1NGYyMmI0NGNhY2RlZjcwOTlkN2Y=|05c1fcee2647069d7ec7dfc875467bb8b0f5b0cd42b4d51c89ceb6d29bc3201b\"; username-localhost-8892=\"2|1:0|10:1522898982|23:username-localhost-8892|44:MjU1YWM5MTVmYzEwNDMzMWJiNTJjYmEyYTJkNGQyOWM=|8f11b0860b57e527dbbe2f607cbf50c3afb795e29b63397f06ea65137e310f09\"; username-localhost-8891=\"2|1:0|10:1522899527|23:username-localhost-8891|44:ZmNhYzdlYmU3MzQxNDBiZDlkNzhkYzA3ZGE0OTc5MTk=|d07ac1753ae5e4e4cb9146360f573b444db5cd612df4ee4a141c4cb423dc6137\""
    }
[E 20:39:04.061 NotebookApp] 500 POST /api/sessions (::1) 60.04ms referer=http://localhost:8891/notebooks/Traffic_Sign_Classifier.ipynb
[I 20:39:04.066 NotebookApp] 302 GET /notebooks/visualize_cnn.png (::1) 1.04ms

Most helpful comment

Sorry, it should have been jupyter kernelspec list. I've made that mistake before. Hopefully you've closed the issue because you figured that out and resolved the problem!

All 3 comments

You probably created a kernelspec which is still around. Use jupyter kernelspecs list to see where it is. The simplest solution is to delete that; Jupyter should fall back to running the kernel on the same version of Python that the notebook server is running on.

campus-110-184:~ domore$ jupyter kernelspecs list
Error executing Jupyter command 'kernelspecs': [Errno 2] No such file or directory

campus-110-184:~ domore$ jupyter --version
4.4.0
campus-110-184:~ domore$ which jupyter
/Library/Frameworks/Python.framework/Versions/3.6/bin/jupyter

Sorry, it should have been jupyter kernelspec list. I've made that mistake before. Hopefully you've closed the issue because you figured that out and resolved the problem!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harshinielath picture harshinielath  路  3Comments

arilwan picture arilwan  路  3Comments

itoed picture itoed  路  3Comments

CarlatBuffalo picture CarlatBuffalo  路  3Comments

arbaazsama picture arbaazsama  路  3Comments