0

I am trying to set up Python under emacs on my company's computer which runs windows XP (64bits).

I tried both python.el and python-mode.el without success.

My current problem is that whenever I use something like C-c C-c to send a .pybuffer to the python process, I get the following error message

apply: Searching for program: no such file or directory, python

A *Python* buffer is created but it as no prompt and I don't know how to interact with it. Pressing RET inside the said buffer raises the following error message

comint-send-string: Output file descriptor of Python is closed

which I fail to interpret.

Python seems to be correctly installed (and added to search path) because M-x shell RET python -i RET correctly begins a Python shell with the >>> prompt.

Do you have any idea about what is wrong with my setup?

M. Toya
  • 615
  • 8
  • 24
  • windows + emacs never work fine. – Ashwini Chaudhary Oct 24 '12 at 07:57
  • I know that. I am trying to sneak an ubuntu distro on a spare computer. – M. Toya Oct 24 '12 at 08:23
  • Save yourself a lot of headache and pain: download virtualbox and install a minimal linux distribution; install some ssh client on the Windows machine and be on your merry way. – Burhan Khalid Oct 24 '12 at 10:06
  • I actually found that there was a stray dash trailing after my path. Strangely it did not broke usage from shell but prevented use from within emacs. I guess the question is actually too localised. I voted for close. – M. Toya Oct 26 '12 at 12:12

2 Answers2

2

What is the value of a variable python-command ?

You can debug run-python function which is defined in python.el. This function creates the internal python process.

Just put a cursor inside the function and execute M-x edebug-defun. You can read more about debugging in the doc.

Oleg Pavliv
  • 20,462
  • 7
  • 59
  • 75
  • I left it default so it's `python`. I'll check the debug. – M. Toya Oct 24 '12 at 08:25
  • I must admit I am a bit confused about what I should do for debugging the function. I did what you said but I just get a message: `run-python`. – M. Toya Oct 24 '12 at 08:40
  • OK, now you close the internal python buffer '*Python*' if any and send a region with C-c C-c. You should stop in the run-python. Then follow with emacs debug commands. – Oleg Pavliv Oct 24 '12 at 08:47
  • Pardon my ignorance but I don't see what you mean by `stop in the run-python` – M. Toya Oct 24 '12 at 08:56
  • Sorry, I mean if you debug a function run-python and you send a region to python then this function will be called and you will be stopped in the debugger. – Oleg Pavliv Oct 24 '12 at 09:00
  • The debugger stops almost at the beginning of the function but I cannot guess what to do next. – M. Toya Oct 24 '12 at 14:20
1

as for python-mode.el that kind of stuff should run

Please file a report at

https://bugs.launchpad.net/python-mode

Andreas Röhler
  • 4,804
  • 14
  • 18