简体   繁体   中英

Jupyter Kernel Error After Catalina OS Update (post Anaconda Fix)

I've tried the fix Anaconda posted in their blog (re-installing with.sh) but I'm still getting a kernel error when I load Jupyter (it can't find 'Users/User/anaconda3' after installing).

Before this I'd also tried installing Python w/ Home-brew but when running Jupyter from this environment it still gave me the same error as I have now:

    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/anaconda3/bin/python': '/anaconda3/bin/python'

Is there a way to edit the directory Jupyter is looking for here?

Any other ideas?

blog post: https://www.anaconda.com/how-to-restore-anaconda-after-macos-catalina-update/

This worked for me: basically, run

python -m ipykernel install --user

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

I would try the link suggested by Arifin, but if that doesn't fix it, here's one that work for me. I encountered the exact same issue as yours after applying the Anaconda Fix :

No such file or directory: '/anaconda3/bin/python': '/anaconda3/bin/python'

Solution

  1. Find all kernels to edit their configuration file

    Open up your terminal and look for all your kernels using jupyter kernelspec list :

     jupyter kernelspec list Available kernels: dataanalysis /Users/samuel/Library/Jupyter/kernels/dataanalysis pedagogy /Users/samuel/Library/Jupyter/kernels/pedagogy python3 /Users/samuel/Library/Jupyter/kernels/python3 tokopedia /usr/local/share/jupyter/kernels/tokopedia
  2. Navigate to each of these kernels, and edit the kernel.json file. You will find that the json file stores values to be parsed and is currently pointing to the old path prior to Catalina update:

     { "argv": [ "/anaconda3/bin/python", "-m", "ipykernel_launcher", "-f", "{connection_file}" ], ... }

    Change the file above to:

     { "argv": [ "/Users/samuel/anaconda3/bin/python", "-m", "ipykernel_launcher", "-f", "{connection_file}" ], ... }

I've performed this on both my work and personal apple machines today and can confirm it works both times. To clean up all your paths after the Catalina update, also nice to just find all references to the old (broken) link and replace them with the new one:

grep -R "/anaconda3" ~

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM