Anaconda Jupyter WinError2:The system cannot find the file specified


Traceback (most recent call last):
  File "C:\Users\builder\Miniconda3\Scripts\conda-build-script.py", line 4, in <module>
    sys.exit(main())
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\main_build.py", line 110, in main
    args_func(args, p)
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\main_build.py", line 312, in args_func
    args.func(args, p)
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\main_build.py", line 272, in execute
    build.build(m, verbose=not args.quiet, post=post)
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\build.py", line 365, in build
    windows.build(m)
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\windows.py", line 95, in build
    env.update(environ.get_dict(m))
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\environ.py", line 94, in get_dict
    d.update(**get_git_build_info(d['SRC_DIR']))
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\environ.py", line 47, in get_git_build_info
    env=env)
  File "C:\Users\builder\Miniconda3\lib\subprocess.py", line 858, in __init__
    restore_signals, start_new_session)
  File "C:\Users\builder\Miniconda3\lib\subprocess.py", line 1111, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

貌似這個問題是因為以前裝Anaconda,后來卸載之后重新裝,發現不能解決問題,開始是jupyter qtconsole不能用,后來變成了jupyter notebook也不能用了,於是上網看解決這個問題的方法,貌似是因為已經建立了一個kernel,但是這個kernel的地址和anaconda默認的地址不一致,所以需要重新設置地址。

解決辦法也很簡單
打開CMD或者Powershell, 輸入

jupyter kernelspec list

會顯示出你所有的kernel,然后將其刪除,比如kernel的名字叫做python3,輸入

jupyter kernelspec remove python3

然后輸入

jupyter kernelspec install-self --user

這樣就可以重新打開qtconsole和notebook了

Reference:

  1. https://github.com/conda/conda-build/issues/331
  2. http://stackoverflow.com/questions/35697794/ipython-kernel-error-after-uninstalling-anaconda


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM