2014-05-06 29 views
0

我喜歡Emacs,但我堅持使用Windows 7.我已經安裝了Cygwin,並且可以使用Emacs進行基本的編輯任務。我可以設置Emacs運行IPython的Cygwin安裝,但我寧願運行Enthought Python Distribution版本的IPython。如何在Cygwin下的Emacs中爲我的Enthought Python Distrubution安裝運行IPython?

在從here意見,我增加了以下我~/.emacs文件:

(when (executable-find "ipython") 
    (setq 
    python-shell-interpreter "/cygdrive/c/Python27/Scripts/ipython.bat" 
    python-shell-interpreter-args "" 
    python-shell-prompt-regexp "In \\[[0-9]+\\]: " 
    python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: " 
    python-shell-completion-setup-code 
    "from IPython.core.completerlib import module_completion" 
    python-shell-completion-module-string-code 
    "';'.join(module_completion('''%s'''))\n" 
    python-shell-completion-string-code 
    "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")) 

注意我修改了第三行指向ipython.bat。然後我開始解釋,它加載EPD,但我得到以下錯誤,不能做任何事情:

--------------------------------------------------------------------------- 
IOError         Traceback (most recent call last) 
C:\Users\username\My Documents\python\<ipython-input-2-6552ae2ca310> in <module>() 
----> 1 __pyfile = open('''/tmp/py6644bAS''');exec(compile(__pyfile.read(), '''/tmp/py6644bAS''', 'exec'));__pyfile.close() 

IOError: [Errno 2] No such file or directory: '/tmp/py6644bAS' 
--------------------------------------------------------------------------- 
IOError         Traceback (most recent call last) 
C:\Users\username\My Documents\python\<ipython-input-3-492fce3681b4> in <module>() 
----> 1 __pyfile = open('''/tmp/py6644XOK''');exec(compile(__pyfile.read(), '''/tmp/py6644XOK''', 'exec'));__pyfile.close() 

IOError: [Errno 2] No such file or directory: '/tmp/py6644XOK' 

任何意見或其他方式,讓我通過Cygwin運行環保署IPython都安裝在Emacs?

回答

0

下面的方式如何調整的python-mode.el與蟒蛇工作 - 不正是你所尋找的,但它可能會提供一些線索:

(defun ipython (&optional argprompt) 
    "Start an IPython interpreter. 

Optional \\[universal-argument] prompts for options to pass to the IPython interpreter. See `py-python-command-args'. " 
    (interactive "P") 
    (setq py-ipython-command "C:\\Users\\MYNAME\\Anaconda\\Scripts\\ipython.exe") 
    (py-shell argprompt nil py-ipython-command)) 
+0

這確實有助於在一定程度上:我也有安裝了Enthought Canopy,它有一個ipython.exe腳本而不是ipython.bat。 – user3609282

相關問題