Windows 8 + Emacs 24.3 + emacs-for-python:Pymacs助手在30秒内没有启动 [英] Windows 8 + Emacs 24.3 + emacs-for-python: Pymacs helper did not start within 30 seconds

查看:128
本文介绍了Windows 8 + Emacs 24.3 + emacs-for-python:Pymacs助手在30秒内没有启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了Emacs 24.3,并尝试使用它编码Python(v3.3.2 x86-64 MSI安装程序)。 (我是Emacs的新手)。然后,我尝试通过解压缩zip来安装emacs-for-python。

 C:\Users\mmsc\ AppData\Roaming\.emacs.d\emacs-for-python

文件夹并添加

  :(加载文件〜/ .emacs.d / emacs-for-python / epy-init.el) 

into C:\Users\mmsc\AppData\Roaming.emacs



在我启动Emacs后,我看到错误


警告(初始化):发生错误加载
`c:/Users/Klein/AppData/Roaming/.emacs':



错误:Pymacs助手在30秒内没有启动



为确保正常运行,您应调查并删除
原因导致的初始化文件中的错误。使用
`--debug-init'选项启动Emacs以查看完整的错误回溯。


与 - -debug-init,我看到下面的信息,但是我对Emacs / Lisp知之甚少,所以我找不到这个问题很容易。

 调试器输入 -  Lisp错误:(错误Pymacs帮手没有在30秒内启动)
信号(错误(Pymacs助手没有在30秒内启动)
pymacs-报告错误(Pymacs帮助器在%d秒内没有启动30)
(if(accept-process-output process pymacs-timeout-at-start)nil(pymacs-report-errorPymacs帮助器没有在%d秒内启动pymacs-timeout-at-start)
(while(progn(goto-char(point-min))(not(re-search-forward< \\ 0-9] + \\)nil t)))(if(accept-process-output process pymacs-timeout-at-start)nil(pymacs-report-errorPymacs助手没有在%d秒内启动pymacs-timeout-at-start))
(let((process(apply(qu ote start-process)pymacsbuffer(let((python(getenvPYMACS_PYTHON)))(if(或(null python)(equal python))pymacs-python-command python))-c concatimport sys;来自Pymacs import main;main(* sys.argv [1:]))(append(and(> = emacs-major-version 24)(quote(-f) )((progn(goto-char(point-min)))(not(re(re) -search-forward< \\(0-9+ \\)nil t)))(if(accept-process-output process pymacs-timeout-at-start)nil(pymacs-报告错误Pymacs帮助器在%d秒内没有启动pymacs-timeout-at-start)))(let((marker-process process))(limit-position(+(match-end 0) -to-number(match-string 1))))))(while(< (标记位置标记)限制位置)(if(accept-process-output process pymacs-timeout-at-start)nil(pymacs-report-errorPymacs帮助器可能在开始时被中断))))
(pro((process(apply start-process)pymacsbuffer(let((python ...))(if(或... ...)pymacs-python-command python)) -c(concatimport sys;from Pymacs import main;main(* sys.argv [1:]))(append(and(> = emacs-major-version 24) ()()()()()()()()()()()()() (re-search-forward< \\([0-9] + \\)nil t)))(if(accept-process-output process pymacs-timeout-at-start)nil pymacs-report-errorPymacs帮助器在%d秒内没有启动pymacs-timeout-at-start)))(let((marker-process process))(limit-position(+(match-end 0) (string-to-number(match-string 1)))))(while(<(marker-position marker)limit-position))(if(accept-p加载输出过程pymacs-timeout-at-start)nil(pymacs-report-errorPymacs helper可能在开始时被中断)))))(goto-char(match-end 0))(let((reply read(current-buffer))))if(and(pymacs-proper-list-p reply)(=(length reply)2)(eq(car reply)(quote version)))(if(string-equal (pymacs-report-errorPymacs-report-errorPymacs得到无效的初始回复))))(pymacs-report-errorPymacs-report-errorPymacs Lisp version is 0.25,Python is%s
(unwind-protect(progn(let((开始进程))pymacsbuffer(let(...)(if ... pymacs-python-command python))-c (concatimport sys;from Pymacs import main;main(* sys.argv [1:]))(append(and ... ...)(mapcar ... pymacs-load-path ()()()()()()()()()()() + \\)nil t)))(if(accept-process-output process pymacs-timeout-at-start)nil(pymacs-report-errorPymacs helper没有t开始在%d秒内pymacs-timeout-at-start)))(let((marker-process process))(limit-position(+(match-end 0)(string-to-number ... ))))(while(< (标记位置标记)限制位置)(if(accept-process-output process pymacs-timeout-at-start)nil(pymacs-report-errorPymacs helper可能在开始时被中断)))))(goto -char(match-end 0))(let((reply(read(current-buffer))))(if(and(pymacs-proper-list-p reply)回复)(if(string-equal(cadr reply)0.25)nil(pymacs-report-errorPymacs Lisp version is 0.25,Python is%s(cadr reply)))(pymacs-报告错误Pymacs收到无效的初始回复))))(set-match-data save-match-data-internal(quote evaporation)))
(let((save-match-data-internal匹配数据)))(unwind-protect(progn(let(apply(quote start-process)pymacsbuffer(let ... ...)-c(concatimport sys;来自Pymacs import main;main(* sys.argv [1:]))(append ... ...))))(pymacs-kill-without-query process)(while(progn(goto-char (point-min))(not(re-search-forward< \\([0-9] + \\)nil t)))(if(accept-pro cess-output process pymacs-timeout-at-start)nil(pymacs-report-errorPymacs帮助器在%d秒内没有启动pymacs-timeout-at-start)))(let((marker(process-mark process) ))(limit-position(+ ... ...)))(while(< (标记位置标记)限制位置)(if(accept-process-output process pymacs-timeout-at-start)nil(pymacs-report-errorPymacs helper可能在开始时被中断)))))(goto -char(match-end 0))(let((reply(read(current-buffer))))(if(and(pymacs-proper-list-p reply)回复)(if(string-equal(cadr reply)0.25)nil(pymacs-report-errorPymacs Lisp version is 0.25,Python is%s(cadr reply)))(pymacs-报告错误Pymacs得到无效的初始回复))))(set-match-data save-match-data-internal(引用蒸发))))
(保存当前缓冲区(buffer-disable-undo)(pymacs-set-buffer-multibyte nil)(set-buffer-file-coding-system(引用原始文本))(let((save-match-data-内部(匹配数据)))(展开保护(progn(let(应用...pymacs缓冲区...-c...)))(pymacs-kill-without -query过程)(while(progn(goto-char ...)(not ...))(if(accept-process-output process p ymacs-timeout-at-start)nil(pymacs-report-errorPymacs帮助器在%d秒内没有启动pymacs-timeout-at-start)))(let((marker ...)(limit-position) ..))(while(< ...()(if(...))))(goto-char(match-end 0))(let((reply(read ...)))(if(and(pymacs -proper-list-p reply)(= ... 2)(eq ... ...))(if(string-equal ...0.25)nil(pymacs-report-errorPymacs Lisp version is 0.25,Python是%s...))(pymacs-report-errorPymacs得到无效的初始回复))))(set-match-data save-match-data-internal(引用蒸发)))) )
(let((buffer(get-buffer-create* Pymacs *)))(save-current-buffer(set-buffer buffer)(擦除缓冲区)(buffer-disable-undo)(pymacs (set-buffer-file-coding-system(quote raw-text))(let((save-match-data-internal(match-data)))(unwind-protect(progn let((process ...))(pymacs-kill-without-query process)(while(progn ... ...)(if ... nil ...))(let(...) )(while ... ...)))(goto-char(match-end 0))(let((reply ...))(if(and ... ... ...) .. nil ...)(pymacs-report-errorPymacs得到无效的初始回复))))(set-match-data save-match-data-internal(quote evap (如果(不是pymacs-use-hash-tables)(setq pymacs-weak-hash t)(如果pymacs-used-ids(progn(let((pymacs-transit-buffer buffer))(pymacs-忘记可变性t)(pymacs-gc-suppress t))(pymacs-callzombie_pythonpymacs-used-id))(setq pymacs-used-id)))(setq pymacs-weak-hash(make-hash -table:weak(quote value)))(if(boundp(quote post-gc-hook))(add-hook(quote post-gc-hook)(quote pymacs-schedule-gc))(setq pymacs-gc-定时器(运行时20 20(引用pymacs-schedule-gc)))))(setq pymacs-transit-buffer buffer)(let((modules pymacs-load-history)))(setq pymacs-load-history nil )(if(and modules(yes-or-no-pReload modules in previous session? ))(progn(function(lambda(args)(condition-case err ... ...)))))))
pymacs-start-services()
如果(和pymacs-transit-buffer(buffer-name pymacs-transit-buffer)(get-buffer-process pymacs-transit-buffer))没有(如果pymacs-weak-hash(progn(if(或(eq pymacs-auto -restart t)(和(eq pymacs-auto-restart(quote ask))(yes-or-no-pPymacs helper死了,重新启动它?)))nil(pymacs-report-error没有Pymacs helper!)))(pymacs-start-services))
pymacs-serve-until-reply(eval(pymacs-print-for-apply(quotepymacs_load_helper)(quote(ropemacs (p ()()()()()()()()()() Pymacs加载%s ...完成模块)(run-hook-with-args(quote pymacs-after-load-functions)模块)结果))(noerror(消息Pymacs loading%s ... failedmodule)nil)))
pymacs-load(ropemacsrope-)
setup-ropemacs()
(progn(setup-ropemacs)(autoload(quote virtualenv-activate)virtualenv激活由PATH指定的虚拟环境t)(autoload(quote virtualenv-workon)virtualenv使用virtualenvwrapper激活存在的虚拟环境(add(hook)()()()()() (virtualenv-activate virtualenv)(desktop-change-dir virtualenv))
(lambda nil(progn(setup-ropemacs)(autoload(quote virtualenv-activate))virtualenv激活由PATH指定的虚拟环境 t)(autoload(quote virtualenv-workon)virtualenv激活使用virtualenvwrapper存在的虚拟环境t)(add-hook(引用python-mode-hook)(lambda nil(if(buffer-file-name) -mode))))(defun workon-postactivate(virtual env)(require(quote virtualenv))(virtualenv-activate virtualenv)(desktop-change-dir virtualenv))))()
funcall((lambda nil(progn(setup-ropemacs)(autoload(quote virtualenv-激活)virtualenv激活由PATH指定的虚拟环境t)(autoload(quote virtualenv-workon)virtualenv使用virtualenvwrapper激活存在的虚拟环境t)(add-hook(quote python-mode-hook) (lambda(nil(if(buffer-file-name)(flymake-mode))))(defun workon-postactivate(virtualenv)(require(quote virtualenv))(virtualenv-activate virtualenv)(desktop-change-dir virtualenv) ))
eval((funcall(quote nil(progn(setup-ropemacs)(autoload(quote virtualenv-activate))virtualenv激活由PATH指定的虚拟环境(autoload(quote virtualenv )(虚拟机)(虚拟机)(虚拟机)(虚拟机)(虚拟环境)(虚拟环境)(虚拟环境) defun workon-postactiv ate(virtualenv)(require(quote virtualenv))(virtualenv-activate virtualenv)(desktop-change-dir virtualenv)))))))
eval-after-load(python(progn(setup-ropemacs) autoload(quote virtualenv-activate)virtualenv激活由PATH指定的虚拟环境t)(autoload(quote virtualenv-workon)virtualenv使用virtualenvwrapper激活存在的虚拟环境t)(add python -mode-hook)(lambda nil(if(buffer-file-name)(flymake-mode))))(defun workon-postactivate(virtualenv)(require(quote virtualenv))(virtualenv-activate virtualenv) -dir virtualenv))))
eval-buffer(#< buffer * load * -819053> nilc:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-python.elnil t);在缓冲位置读取4662
加载代码转换(c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-python.elc:/用户/ mmsc / AppData / Roaming / .emacs.d / emacs-for-python / epy-python.elnil t)
require(epy-python)
eval-buffer(# * load * -283406> nilc:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-init.elnil t);在缓冲位置读取476
加载代码转换(c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-init.elc:/用户/ mmsc / AppData / Roaming / .emacs.d / emacs-for-python / epy-init.elnil nil)
load(c:/Users/mmsc/AppData/Roaming/.emacs.d /emacs-for-python/epy-init.elnil nil t)
load-file(C:\\Users\\mmsc\\AppData\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ )
eval-buffer(#< buffer * load *> nilc:/ Users / mmsc / AppData / Roaming / .emacsnil t);在缓冲位置读取656
加载代码转换(c:/Users/mmsc/AppData/Roaming/.emacsc:/Users/mmsc/AppData/Roaming/.emacstt)
load(〜/ .emacstt)

我试图搜索一些帮助互联网,但大多数是针对Linux / Unix环境。有没有人在Windows下使用Emacs与Python,知道这是什么意思,我该如何解决?



谢谢!

解决方案

这是一个有点太多的评论:

 (let ((进程
(应用'start-process'pymacs缓冲区
(let((python(getenvPYMACS_PYTHON)))
(if(或(null python)
pymacs-python-command
python))
-c(concatimport sys;
来自Pymacs import main;
main(* sys.argv [1:]))
(附加
(和(> = emacs-major-version 24)'(-f))
'expand-file-name pymacs-load-path)))))

Pymacs代码在 * Pymacs中启动过程* 缓冲区。您可以从此推断,Pymacs将首先搜索环境变量 $ PYMACS_PYTHON ,如果不存在或值为空字符串,那么它将尝试 pymacs-python-command ,默认情况下是python。所以,它会进行这样的调用:

  $ python -c'import sys;从Pymacs进口主要; main(* sys.argv [1:])'

-f - 我不知道什么版本的Python接受这个参数,但是我没有。这个代码的意图很清楚 - 可能它必须在 pymacs-load-path 上加载文件,但是对于我来说,这个变量的值是 nil - 所以我不认为这段代码没有运行。无论如何,这个观点似乎并没有受到伤害,对我来说,它的启动与否只是一样。



所以,如果你尝试在控制台中运行上面的命令,并得到以下内容:

 (版本0.25)

然后这段代码工作正常,否则你会收到一些错误,这将有助于您识别问题。请记住,它可能不只是 python 。它是 $ PYMACS_PYHON pymacs-python-command


I recently installed Emacs 24.3 and try to use it coding for Python (v3.3.2 x86-64 MSI installer). (I'm new to Emacs). Then i try to install emacs-for-python by unpack the zip to

"C:\Users\mmsc\AppData\Roaming\.emacs.d\emacs-for-python" 

folder and add

: (load-file "~/.emacs.d/emacs-for-python/epy-init.el") 

into C:\Users\mmsc\AppData\Roaming.emacs

after I launch Emacs, I see error

Warning (initialization): An error occurred while loading `c:/Users/Klein/AppData/Roaming/.emacs':

error: Pymacs helper did not start within 30 seconds

To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace.

with the "--debug-init", I saw below information but I have little knowledge about Emacs/Lisp, so I can't locate the problem easily.

Debugger entered--Lisp error: (error "Pymacs helper did not start within 30 seconds")
  signal(error ("Pymacs helper did not start within 30 seconds"))
  pymacs-report-error("Pymacs helper did not start within %d seconds" 30)
  (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))
  (while (progn (goto-char (point-min)) (not (re-search-forward "<\\([0-9]+\\)  " nil t))) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start)))
  (let ((process (apply (quote start-process) "pymacs" buffer (let ((python (getenv "PYMACS_PYTHON"))) (if (or (null python) (equal python "")) pymacs-python-command python)) "-c" (concat "import sys;" " from Pymacs import main;" " main(*sys.argv[1:])") (append (and (>= emacs-major-version 24) (quote ("-f"))) (mapcar (quote expand-file-name) pymacs-load-path))))) (pymacs-kill-without-query process) (while (progn (goto-char (point-min)) (not (re-search-forward "<\\([0-9]+\\)  " nil t))) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))) (let ((marker (process-mark process)) (limit-position (+ (match-end 0) (string-to-number (match-string 1))))) (while (< (marker-position marker) limit-position) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper probably was interrupted at start")))))
  (progn (let ((process (apply (quote start-process) "pymacs" buffer (let ((python ...)) (if (or ... ...) pymacs-python-command python)) "-c" (concat "import sys;" " from Pymacs import main;" " main(*sys.argv[1:])") (append (and (>= emacs-major-version 24) (quote ...)) (mapcar (quote expand-file-name) pymacs-load-path))))) (pymacs-kill-without-query process) (while (progn (goto-char (point-min)) (not (re-search-forward "<\\([0-9]+\\)   " nil t))) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))) (let ((marker (process-mark process)) (limit-position (+ (match-end 0) (string-to-number (match-string 1))))) (while (< (marker-position marker) limit-position) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper probably was interrupted at start"))))) (goto-char (match-end 0)) (let ((reply (read (current-buffer)))) (if (and (pymacs-proper-list-p reply) (= (length reply) 2) (eq (car reply) (quote version))) (if (string-equal (cadr reply) "0.25") nil (pymacs-report-error "Pymacs Lisp version is 0.25, Python is %s" (cadr reply))) (pymacs-report-error "Pymacs got an invalid initial reply"))))
  (unwind-protect (progn (let ((process (apply (quote start-process) "pymacs" buffer (let (...) (if ... pymacs-python-command python)) "-c" (concat "import sys;" " from Pymacs import main;" " main(*sys.argv[1:])") (append (and ... ...) (mapcar ... pymacs-load-path))))) (pymacs-kill-without-query process) (while (progn (goto-char (point-min)) (not (re-search-forward "<\\([0-9]+\\)  " nil t))) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))) (let ((marker (process-mark process)) (limit-position (+ (match-end 0) (string-to-number ...)))) (while (< (marker-position marker) limit-position) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper probably was interrupted at start"))))) (goto-char (match-end 0)) (let ((reply (read (current-buffer)))) (if (and (pymacs-proper-list-p reply) (= (length reply) 2) (eq (car reply) (quote version))) (if (string-equal (cadr reply) "0.25") nil (pymacs-report-error "Pymacs Lisp version is 0.25, Python is %s" (cadr reply))) (pymacs-report-error "Pymacs got an invalid initial reply")))) (set-match-data save-match-data-internal (quote evaporate)))
  (let ((save-match-data-internal (match-data))) (unwind-protect (progn (let ((process (apply (quote start-process) "pymacs" buffer (let ... ...) "-c" (concat "import sys;" " from Pymacs import main;" " main(*sys.argv[1:])") (append ... ...)))) (pymacs-kill-without-query process) (while (progn (goto-char (point-min)) (not (re-search-forward "<\\([0-9]+\\)   " nil t))) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))) (let ((marker (process-mark process)) (limit-position (+ ... ...))) (while (< (marker-position marker) limit-position) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper probably was interrupted at start"))))) (goto-char (match-end 0)) (let ((reply (read (current-buffer)))) (if (and (pymacs-proper-list-p reply) (= (length reply) 2) (eq (car reply) (quote version))) (if (string-equal (cadr reply) "0.25") nil (pymacs-report-error "Pymacs Lisp version is 0.25, Python is %s" (cadr reply))) (pymacs-report-error "Pymacs got an invalid initial reply")))) (set-match-data save-match-data-internal (quote evaporate))))
  (save-current-buffer (set-buffer buffer) (erase-buffer) (buffer-disable-undo) (pymacs-set-buffer-multibyte nil) (set-buffer-file-coding-system (quote raw-text)) (let ((save-match-data-internal (match-data))) (unwind-protect (progn (let ((process (apply ... "pymacs" buffer ... "-c" ... ...))) (pymacs-kill-without-query process) (while (progn (goto-char ...) (not ...)) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))) (let ((marker ...) (limit-position ...)) (while (< ... limit-position) (if ... nil ...)))) (goto-char (match-end 0)) (let ((reply (read ...))) (if (and (pymacs-proper-list-p reply) (= ... 2) (eq ... ...)) (if (string-equal ... "0.25") nil (pymacs-report-error "Pymacs Lisp version is 0.25, Python is %s" ...)) (pymacs-report-error "Pymacs got an invalid initial reply")))) (set-match-data save-match-data-internal (quote evaporate)))))
  (let ((buffer (get-buffer-create "*Pymacs*"))) (save-current-buffer (set-buffer buffer) (erase-buffer) (buffer-disable-undo) (pymacs-set-buffer-multibyte nil) (set-buffer-file-coding-system (quote raw-text)) (let ((save-match-data-internal (match-data))) (unwind-protect (progn (let ((process ...)) (pymacs-kill-without-query process) (while (progn ... ...) (if ... nil ...)) (let (... ...) (while ... ...))) (goto-char (match-end 0)) (let ((reply ...)) (if (and ... ... ...) (if ... nil ...) (pymacs-report-error "Pymacs got an invalid initial reply")))) (set-match-data save-match-data-internal (quote evaporate))))) (if (not pymacs-use-hash-tables) (setq pymacs-weak-hash t) (if pymacs-used-ids (progn (let ((pymacs-transit-buffer buffer) (pymacs-forget-mutability t) (pymacs-gc-inhibit t)) (pymacs-call "zombie_python" pymacs-used-ids)) (setq pymacs-used-ids nil))) (setq pymacs-weak-hash (make-hash-table :weakness (quote value))) (if (boundp (quote post-gc-hook)) (add-hook (quote post-gc-hook) (quote pymacs-schedule-gc)) (setq pymacs-gc-timer (run-at-time 20 20 (quote pymacs-schedule-gc))))) (setq pymacs-transit-buffer buffer) (let ((modules pymacs-load-history)) (setq pymacs-load-history nil) (if (and modules (yes-or-no-p "Reload modules in previous session? ")) (progn (mapc (function (lambda (args) (condition-case err ... ...))) modules)))))
  pymacs-start-services()
  (if (and pymacs-transit-buffer (buffer-name pymacs-transit-buffer) (get-buffer-process pymacs-transit-buffer)) nil (if pymacs-weak-hash (progn (if (or (eq pymacs-auto-restart t) (and (eq pymacs-auto-restart (quote ask)) (yes-or-no-p "The Pymacs helper died.  Restart it? "))) nil (pymacs-report-error "There is no Pymacs helper!")))) (pymacs-start-services))
  pymacs-serve-until-reply("eval" (pymacs-print-for-apply (quote "pymacs_load_helper") (quote ("ropemacs" "rope-" nil))))
  pymacs-call("pymacs_load_helper" "ropemacs" "rope-" nil)
  (let ((lisp-code (pymacs-call "pymacs_load_helper" module prefix noerror))) (cond (lisp-code (let ((result (eval lisp-code))) (add-to-list (quote pymacs-load-history) (list module prefix noerror) (quote append)) (message "Pymacs loading %s...done" module) (run-hook-with-args (quote pymacs-after-load-functions) module) result)) (noerror (message "Pymacs loading %s...failed" module) nil)))
  pymacs-load("ropemacs" "rope-")
  setup-ropemacs()
  (progn (setup-ropemacs) (autoload (quote virtualenv-activate) "virtualenv" "Activate a Virtual Environment specified by PATH" t) (autoload (quote virtualenv-workon) "virtualenv" "Activate a Virtual Environment present using virtualenvwrapper" t) (add-hook (quote python-mode-hook) (lambda nil (if (buffer-file-name) (flymake-mode)))) (defun workon-postactivate (virtualenv) (require (quote virtualenv)) (virtualenv-activate virtualenv) (desktop-change-dir virtualenv)))
  (lambda nil (progn (setup-ropemacs) (autoload (quote virtualenv-activate) "virtualenv" "Activate a Virtual Environment specified by PATH" t) (autoload (quote virtualenv-workon) "virtualenv" "Activate a Virtual Environment present using virtualenvwrapper" t) (add-hook (quote python-mode-hook) (lambda nil (if (buffer-file-name) (flymake-mode)))) (defun workon-postactivate (virtualenv) (require (quote virtualenv)) (virtualenv-activate virtualenv) (desktop-change-dir virtualenv))))()
  funcall((lambda nil (progn (setup-ropemacs) (autoload (quote virtualenv-activate) "virtualenv" "Activate a Virtual Environment specified by PATH" t) (autoload (quote virtualenv-workon) "virtualenv" "Activate a Virtual Environment present using virtualenvwrapper" t) (add-hook (quote python-mode-hook) (lambda nil (if (buffer-file-name) (flymake-mode)))) (defun workon-postactivate (virtualenv) (require (quote virtualenv)) (virtualenv-activate virtualenv) (desktop-change-dir virtualenv)))))
  eval((funcall (quote (lambda nil (progn (setup-ropemacs) (autoload (quote virtualenv-activate) "virtualenv" "Activate a Virtual Environment specified by PATH" t) (autoload (quote virtualenv-workon) "virtualenv" "Activate a Virtual Environment present using virtualenvwrapper" t) (add-hook (quote python-mode-hook) (lambda nil (if (buffer-file-name) (flymake-mode)))) (defun workon-postactivate (virtualenv) (require (quote virtualenv)) (virtualenv-activate virtualenv) (desktop-change-dir virtualenv)))))))
  eval-after-load(python (progn (setup-ropemacs) (autoload (quote virtualenv-activate) "virtualenv" "Activate a Virtual Environment specified by PATH" t) (autoload (quote virtualenv-workon) "virtualenv" "Activate a Virtual Environment present using virtualenvwrapper" t) (add-hook (quote python-mode-hook) (lambda nil (if (buffer-file-name) (flymake-mode)))) (defun workon-postactivate (virtualenv) (require (quote virtualenv)) (virtualenv-activate virtualenv) (desktop-change-dir virtualenv))))
  eval-buffer(#<buffer  *load*-819053> nil "c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-python.el" nil t)  ; Reading at buffer position 4662
  load-with-code-conversion("c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-python.el" "c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-python.el" nil t)
  require(epy-python)
  eval-buffer(#<buffer  *load*-283406> nil "c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-init.el" nil t)  ; Reading at buffer position 476
  load-with-code-conversion("c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-init.el" "c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-init.el" nil nil)
  load("c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-init.el" nil nil t)
  load-file("C:\\Users\\mmsc\\AppData\\Roaming\\.emacs.d\\emacs-for-python\\epy-init.el")
  eval-buffer(#<buffer  *load*> nil "c:/Users/mmsc/AppData/Roaming/.emacs" nil t)  ; Reading at buffer position 656
  load-with-code-conversion("c:/Users/mmsc/AppData/Roaming/.emacs" "c:/Users/mmsc/AppData/Roaming/.emacs" t t)
  load("~/.emacs" t t)

I have tried to search some help from Internet but most of them are for Linux/Unix env. Is there anyone using Emacs with Python under Windows and know what does this mean and how can I fix it?

Thanks!

解决方案

This was a little too much for a comment:

    (let ((process
           (apply 'start-process "pymacs" buffer
                  (let ((python (getenv "PYMACS_PYTHON")))
                    (if (or (null python) (equal python ""))
                        pymacs-python-command
                      python))
                  "-c" (concat "import sys;"
                               " from Pymacs import main;"
                               " main(*sys.argv[1:])")
                  (append
                   (and (>= emacs-major-version 24) '("-f"))
                   (mapcar 'expand-file-name pymacs-load-path)))))

This is the bit of Pymacs code which starts the process in *Pymacs* buffer. You could infer from this that Pymacs will first search for environment variable $PYMACS_PYTHON and if that doesn't exist or it's value is empty string, then it will try pymacs-python-command, which, by default is "python". So, it will make this call:

$ python -c 'import sys; from Pymacs import main; main(*sys.argv[1:])'

There's a problem with -f - I don't know what version of Python accepts this argument, but then one that I have doesn't. The intention of this code is quite clear - probably it has to load the files on pymacs-load-path, but for me the value of this variable is nil - so I don't think this code ever runs. Anyway, this argument doesn't seem to harm as for me it launches with or without it just the same.

So, if you try running the above command in console, and get something like:

(version "0.25")

Then this code works fine, otherwise, you'd get some error and that would help you identify the problem. Remember that it may not be just python. It is either $PYMACS_PYHON or pymacs-python-command.

这篇关于Windows 8 + Emacs 24.3 + emacs-for-python:Pymacs助手在30秒内没有启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆