Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing IPython to work with a non-default python version (i.e python2.6.6/python2.7) on OSX Snow Leopard

OK guys this is tricky, and I haven't even found a suitable solution on the IPython website.

I'm working on OSX Snow Leopard. I've installed IPython using easy-install, plus all the additional basic add-ons:

$ sudo easy-install readline pexpect nose ipython

Everything worked OK and installed correctly.

The problem is that IPython uses the python 2.6.1 interpreter, but I would like to use the python 2.6.6 or python 2.7. It is necessary since I'm using the "pygame" module, which only works with my python 2.6.6 installation.

How can I do that? Thanks in advance.


Another solution:

(besides the already accepeted answer, thanks for that btw.)

I just used pip to pip uninstall ipython and then sudo pip install ipython. This installed it against my latest python version. Thanks for the other version though! I've come to use pip for all my python installation necessities instead of easy_install as of late.

like image 929
Ory Band Avatar asked Nov 17 '10 00:11

Ory Band


People also ask

How do I find the IPython notebook?

1) Download and install canopy on your computer. 2) To check whether canopy has installed successfully, go to command prompt and type IPython notebook, and press enter. 3) Ipython notebook will open in your browser. Click on new notebook to open a new Ipython notebook.


3 Answers

I just got the same problem, and I think I found a solution.

After update your python to a non-default version, say 2.6.6, you must also reinstall setup-tools. To verify if your easy_install is correctly installed, type "which easy_install" to see if easy_install is under "/Library/Frameworks/Python.framework/Versions/2.6/bin/" directory, if not, it might show in "/usr/bin/", then you need to download the right version of setup-tools, for example, for 2.6.6, it's setuptools-0.6c11-py2.6.egg, and use "sh ./setuptools-0.6c11-py2.6.egg" to install it. After all that, you need to reopen Teminal just to make all env-variables get refreshed, and then when you use "easy_install ipython", you can get the right version working with ipython.

It works for me, and I hope it can help you, too.

like image 138
frank28_nfls Avatar answered Sep 29 '22 00:09

frank28_nfls


Invoke the version of easy_install installed with the appropriate version of Python.

easy_install-2.7 ...
like image 39
Ignacio Vazquez-Abrams Avatar answered Sep 28 '22 22:09

Ignacio Vazquez-Abrams


This instructions on the following link worked for me:

http://blog.praveengollakota.com/47430655 (do make sure to follow the easy_install step so that python2.7 will get picked up by easy_install!!)

I had to do the following additional steps to get things to work properly:

1) Update ~/.profile to add the "/Library/Frameworks/Python.framework/Versions/2.7/bin" to my $PYTHONPATH and source it to make sure that the old ipython path wasn't being picked up.

2) Do "sudo easy_install readline" to ensure the tab completions and other features of ipython work properly.

(In my case, I also use pymongo, so I did have to uninstall (sudo pip uninstall pymongo) and install (sudo easy_install pymongo) to get the pymongo package to work).

Hope this helps.

like image 22
mukund Avatar answered Sep 29 '22 00:09

mukund