Question

I'm doing some work with a custom version of Python 2.6 on Windows, and would love to use emacs for this purpose. 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 M-x run-python command.

My custom Python is on the path (i.e. can type python from a windows command prompt and get the appropriate version). Unfortunately, I simply get the following error in my *Messages* buffer when attempting to start it with run-python from emacs:

apply: Spawning child process: invalid argument

Is anyone running a similar python config that can shed light on this? Happy to post any other config details as needed.

Was it helpful?

Solution 2

You could try C-u M-x run-python, which gives you the option of selecting the path of the python binary you want to run.

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.

OTHER TIPS

On Windows, when we use standard backward slashes in the init.el file (.emacs): (setq python-shell-interpreter "c:\myRoot\Proframs\Python33\python3.exe")

Emacs interprets this as:
c:myRootProframsPython33python3.exe

This what is the invalid argument I think.

Thus we can: (setq python-shell-interpreter "c:/myRoot/Proframs/Python33/python3.exe")

Now C-u M-x "run-python" works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top