开发者

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

开发者 https://www.devze.com 2023-01-25 05:24 出处:网络
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 bas

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 uninst开发者_运维问答all 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.


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.


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

easy_install-2.7 ...


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.


Why not see if just changing the shebang line in the python\scripts directory works? There should be an IPython starter shell script there. Point it at the full path of the desired Python load and give it a whirl.

Not sure of the full path to the scripts directory on OS X. On Windows it's at c:\Python2x\Scripts.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号