Menu

#38 Setting py-python-command after M-x py-shell doesn't work

open
nobody
None
5
2006-03-12
2006-03-12
No

If I do M-x py-shell, I get an error:

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

That's ok, I just need to set `py-python-command', right?
(setq py-python-command "c:/python24/python.exe")

Then I do M-x py-shell again, I get the same error message:

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

Why didn't setting py-python-command work?

However, if I switch to another buffer, (actually a
buffer in which I haven't tried M-x py-shell before
setting `py-python-command') M-x py-shell will now work.

Discussion

  • Edward Loper

    Edward Loper - 2006-03-12

    Logged In: YES
    user_id=195958

    There's a buffer-local variable "py-which-shell," which is
    used to record what shell command you're using (and
    also "py-which-args"); this gets initialized the first
    time you run py-shell. It appears that the reasoning
    behind this has to do with toggling between cpython and
    jython, but it's not entirely clear to me from looking at
    the code.

    One way to make things a little more user friendly would
    be to add an initializer function to the defcustom that
    defines py-python-command, that calls "(py-toggle-
    shells 'cpython)"; but in your case, that wouldn't have
    helped, since you directly modified py-python-command
    using setq, rather than customize-variable.

    If you just want to get things working in that one buffer,
    the following should work:

    (setq py-python-command "c:/python24/python.exe")
    (py-toggle-shells 'cpython)

     
  • Edward Loper

    Edward Loper - 2006-03-12

    Logged In: YES
    user_id=195958

    There's a buffer-local variable "py-which-shell," which is
    used to record what shell command you're using (and
    also "py-which-args"); this gets initialized the first
    time you run py-shell. It appears that the reasoning
    behind this has to do with toggling between cpython and
    jython, but it's not entirely clear to me from looking at
    the code.

    One way to make things a little more user friendly would
    be to add an initializer function to the defcustom that
    defines py-python-command, that calls "(py-toggle-
    shells 'cpython)"; but in your case, that wouldn't have
    helped, since you directly modified py-python-command
    using setq, rather than customize-variable.

    If you just want to get things working in that one buffer,
    the following should work:

    (setq py-python-command "c:/python24/python.exe")
    (py-toggle-shells 'cpython)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.