ipython安装过程_IPython安装过程 @win7 64bit

IPython安装过程 @win7 64bit

为了尝试一下IPython的使用,今天折腾了很久的从安装包msi文件安装,最后无法成功运行,无奈在可以连外网的机器windows7 64bit环境,重新安装了一次,为了避免后来人少走弯路,记录安装过程(前提是已经安装了官方的Python环境):

由于是64bit环境的,官方提示最好是从源代码安装,所以首先安装官方的步骤,安装setuptools:

参照页面:http://pypi.python.org/pypi/setuptools,自己选择是32bit还是64bit的windows,这里我下载ez_setup.py,运行之后setuptools自动安装好了。

下载IPython最新的源代码包,并解压到本地磁盘。下载地址:https://github.com/ipython/ipython/downloads

进入cmd,进入解压后的源代码目录,执行命令:python setupegg.py install

执行后,可以看到提示安装成功。IPython会安装到你的Python目录下的scripts下面,我本地是C:\Python27\Scripts\IPython.exe

IPython推荐安装readline,下面安装readline。 同样的去 https://launchpad.net/pyreadline/+download 下载readline源码包,

解压后进入源码目录,执行python setup.py install 安装。

最后,为了方便,把IPython的目录加入path环境变量。

emacs IPYTHON

I had the same problem. It has to do with ipython.el not finding the

IPython executable.

To fix it, open ipython.el, and replace line

(when (executable-find "ipython")

with

(when (executable-find "ipython.bat")

Next, add file ipython.bat to your path containing something like the

following:

C:\Python23\python.exe "C:\Program Files\IPython\IPython_shell.py"

Unfortunately it doesn't seem to work right on windows. The prompts

are missing so it's almost unusable.

Yaroslav

Windows XP SP2

Emacs 22.3

ipython 0.9.1

python-mode.el 4.75

ipython.el

these are the steps I needed to get ipython working under emacs

First, to get ipython.el to work you need to edit the ipython.bat file and add a -i flag: i.e.

@C:\Python26\python.exe -i C:\Python26\scripts\ipython.py %*

next, something is broken with the way readline's _outputfile interacts with ipython under emacs/winXP.

I can get IPython working in emacs by modifying line 122 in genutils.py:

if sys.platform == 'win32' and readline.have_readline and (not 'EM_PARENT_PROCESS_ID' in os.environ):

EM_PARENT_PROCESS is a variable inserted into the environment when running processes under emacs.

This tells ipython not to use readline's _outputfile when running under emacs on windows.

NOTE: readline._outputfile is required for proper color display when running ipython from the command shell.

Finally, tab complete is broken under python 2.6 and using my version of ipython.el (may be fixed in the latest version)

In ipython.el, change the value of ipython-completion-command-string to

(defvar ipython-completion-command-string

"print(';'.join(__IP.Completer.all_completions('%s'))) #PYTHON-MODE SILENT\n"

"The string send to ipython to query for all possible completions")

This uses 2.6 print() function conventions, and should work with python 2.5 as well.

It also looks as if the history files generated by the emacs IPython and the command prompt ipython are incompatible; sometimes the emacs IPython will crash with a strange readline error. I've been deleting the _ipython/history file, which is somewhat annoying (but IPython can log sessions easily anyway).

Jie

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值