Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am getting random error while trying to use IPython. I now suddenly cannot use iPython3 with no explanation, I don't remember installing anything heavy besides Ethereum client and I didn't download the hashes or anything. Suddenly I get:

cchilders:~ 
$ ipython3
-bash: /usr/local/bin/ipython3: /usr/local/opt/python3/bin/python3.5: bad interpreter: No such file or directory

neither IPython or IPython3 was working. After uninstalling and reinstalling Python and Python3, I can now use IPython. But the same error from before happens if I try iPython3.

This is one of the more absurd errors I've seen because I've reinstalled IPython, Python itself, and Python3 with no change.

like image 496
codyc4321 Avatar asked Apr 30 '17 00:04

codyc4321


2 Answers

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
like image 98
Floyd Avatar answered Nov 10 '22 22:11

Floyd


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.

like image 2
unstablerealtiy Avatar answered Nov 10 '22 23:11

unstablerealtiy