简体   繁体   English

'run-python'在Emacs 24.3.1 for Windows上失败,自定义供应商提供的Python2.6

[英]'run-python' failing on Emacs 24.3.1 for Windows, custom vendor-supplied Python2.6

I'm doing some work with a custom version of Python 2.6 on Windows, and would love to use emacs for this purpose. 我在Windows上使用自定义版本的Python 2.6做了一些工作,并且很乐意为此目的使用emacs。 On more unixy platforms, I've never had any issue with the basic python-mode stuff, but now I'm encountering a problem when I try to use the Mx run-python command. 在更多unixy平台上,我从来没有遇到任何基本的python-mode问题,但是现在我在尝试使用Mx run-python命令时遇到了问题。

My custom Python is on the path (ie can type python from a windows command prompt and get the appropriate version). 我的自定义Python在路径上(即可以从Windows命令提示符键入python并获取相应的版本)。 Unfortunately, I simply get the following error in my *Messages* buffer when attempting to start it with run-python from emacs: 不幸的是,当我尝试使用emacs的run-python启动时,我只是在我的* Messages *缓冲区中出现以下错误:

apply: Spawning child process: invalid argument

Is anyone running a similar python config that can shed light on this? 是否有人运行类似的python配置,可以阐明这一点? Happy to post any other config details as needed. 很高兴根据需要发布任何其他配置详细信息。

On Windows, when we use standard backward slashes in the init.el file (.emacs): ( setq python-shell-interpreter "c:\\myRoot\\Proframs\\Python33\\python3.exe" ) 在Windows上,当我们在init.el文件(.emacs)中使用标准反斜杠时:( setq python-shell-interpreter "c:\\myRoot\\Proframs\\Python33\\python3.exe"

Emacs interprets this as: Emacs将此解释为:
c:myRootProframsPython33python3.exe

This what is the invalid argument I think. 这就是我认为无效的论点。

Thus we can: ( setq python-shell-interpreter "c:/myRoot/Proframs/Python33/python3.exe" ) 因此我们可以:( setq python-shell-interpreter "c:/myRoot/Proframs/Python33/python3.exe"

Now Cu Mx "run-python" works. 现在Cu Mx“run-python”有效。

You could try Cu Mx run-python , which gives you the option of selecting the path of the python binary you want to run. 您可以尝试使用Cu Mx run-python ,它可以选择您想要运行的python二进制文件的路径。

Alternatively, if you would like to start it using Elisp, that can be achieved by calling (run-python "/usr/bin/python3") for python3, for example. 或者,如果您想使用Elisp启动它,可以通过调用(run-python "/usr/bin/python3")来实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM