therealanshuman
therealanshuman

Reputation: 154

How to change the python interpreter for ipython on mac?

I have python libraries in the following folders on my mac

and, the corresponding binaries as the following files

But, the ipython binary is in /usr/local/Cellar/ipython/6.2.1/bin/ipython and the ipython file /usr/local/bin/ipython has the following line in it -

PYTHONPATH="/usr/local/Cellar/ipython/6.2.1/libexec/lib/python3.6/site-packages:/usr/local/Cellar/ipython/6.2.1/libexec/vendor/lib/python3.6/site-packages" exec "/usr/local/Cellar/ipython/6.2.1/libexec/bin/ipython" "$@"

Therefore, on executing ipython in the terminal the default interpreter is taken as python3.6 by the system. How can I modify these files to change the python interpreter from 3.6 to 2.7?

Following is a screenshot of all the ipython* files in my mac.

enter image description here

Upvotes: 0

Views: 537

Answers (1)

orangeInk
orangeInk

Reputation: 1400

As of version 6, IPython is no longer compatible with Python 2.x.

You can either keep using IPython 6 with Python 3 or downgrade to IPython 5 and use Python 2.

http://ipython.readthedocs.io/en/stable/whatsnew/version6.html#ipython-6-0 https://github.com/Homebrew/brew/issues/2849

Upvotes: 1

Related Questions