2

I have tried to open ipython notebook without luck and don't know why?

When i type the command "ipython notebook", the output i receive is :

-bash: /usr/local/bin/ipython: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

Any help ?

user3870045
  • 41
  • 1
  • 4

2 Answers2

0

This issue can be caused by: multiple python installs, virtualenvs, and/or broken python path variable. If you are using homebrew on mac or anaconda distribution, it can also cause version conflicts with pip and subsequent package installations.

First thing to check is which python interpreter the system thinks it is using:

$ which python
$ which python2.7

this will tell you which is the currently activated python. Also check:

$ which ipython

My guess is that you have 2 or more versions of python installed on your system, and you used pip to get ipython for some active python version as specified by the path variable; pip got confused along the way.

Check your path variable in your bash settings (i.e. .bashrc or .profile), and you may want to set the version that you want. You would want to use the correct pip variant depending on whether you want to use /usr/local/bin/ or /opt/local/bin/python2.7.

Here's more info:

Community
  • 1
  • 1
cchi
  • 991
  • 9
  • 16
0

I just got the same problem when I upgrade my python2.7 to python3 by using homebrew yesterday. Tried googled suggestions but no one really solved the problem. Then I checked the first line of my pip, pip3, ipython, ipython2, ipython3 and jupyter. Found the problem actually is that the first lines of jupyter and ipython2 still point to the old python2.7 path "/usr/local/opt/python/bin/python2.7" which is not exist anymore. So, I just changed the first line to "#!/usr/local/opt/python/bin/python3.6" for jupyter and the problem solved.