分享

ipython reads wrong python version, (ipython3 Mac OS)

 dzh1121 2015-10-17

Okay quick fix:

which python

gives you /usr/bin/python, right? Do

which ipython

and I bet that'll be /usr/local/bin/ipython. Let's look inside:

cat /usr/local/bin/ipython

#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'ipython==0.12.1','console_scripts','ipython'
__requires__ = 'ipython==0.12.1'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('ipython==0.12.1', 'console_scripts', 'ipython')()
    )

Aha - open /usr/local/bin/ipython in your editor (with privileges), and change the first line to

#!/usr/local/bin/python

save, start iPython, should say it's using 2.7.2 now.




同样的solution, 对于ipython3 

(尤其当python3.4 转成了3.5之后)

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多