IPython 3.5 returns "bad interpreter: No such file or directory"

As described here, the problem is that ipython3 is trying to use the python3.5 kernel in /usr/local/opt/python3/bin/python3.5. You can view which kernel ipython3 is trying to use by running:

jupyter kernelspec list

and then viewing the kernel.json file which is in the python3 kernel's path (in my case, the path to kernel.json is: /usr/local/share/jupyter/kernels/python3/kernel.json).

To solve this, I had to reinstall all of the following jupyter packages:

$ pip3 uninstall jupyter jupyter-client jupyter-console jupyter-core
$ pip3 install jupyter jupyter-client jupyter-console jupyter-core

If you are not a Jupyter user, this can be solved by reinstalling ipython

pip uninstall ipython
pip install ipython

I found that I needed sudo to uninstall it due to some additional errors. You may not need it.


For me, the wrong version of jupyter was being invoked. When I was just typing Jupiter, it was looking for installation under 3.7 while it was really installed under the 3.8 directory.

Uninstalling and reinstalling did not help for me. Instead, I had to give the absolute path to the 3.8 version of Jupiter to get past this error.