FAQ
system: win98
python version 2.2.2
emacs 21.2.1
..........
hi all,

I am having diffculty getting the python interpreter to run under emacs,
either from the menu or with C-c ! Syntax highlighting and .py file
recognition works fine.

When I try strating the interpreter with the above Emacs complains:
"Searching for program: No such file or directory, python"

I have set the environment variable HOME to C:\ which is where .emacs
resides, and I have byte compiled python-mode.el which sits in C:\Python22

My .emacs file is as follows:

(setq load-path (cons "C:\Python22" load-path))
(setq auto-mode-alist
(cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
(cons '("python" . python-mode)
interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)

(require 'cua)
(CUA-mode t)

..........
I guessed that (setq interpreter-mode-alist...etc is telling Emacs where
the interpreter is located, and so I tried adjusting the value of
"python" to "C:\Python22\python" and "C:\Python22\python.exe".

However I am slightly confused about when Emacs reloads .emacs. Do I
have to restart windows everytime I make a change, or is there a method
for reloading while Emacs is running?

Any help greatly appreciated.

Cheers,
Selwyn

Search Discussions

  • Jeremy Yallop at Apr 22, 2003 at 8:55 am

    selwyn wrote:
    I am having diffculty getting the python interpreter to run under emacs,
    either from the menu or with C-c ! Syntax highlighting and .py file
    recognition works fine.

    When I try strating the interpreter with the above Emacs complains:
    "Searching for program: No such file or directory, python"
    Perhaps you need to add C:\Python22 to the PATH environment variable.
    Alternatively, you could tell emacs where the Python interpreter lives
    by setting py-python-command to the full path to the executable
    ("C:\Python22\python.exe").
    However I am slightly confused about when Emacs reloads .emacs. Do I
    have to restart windows everytime I make a change, or is there a method
    for reloading while Emacs is running?
    M-x eval-buffer. Also try M-x ielm for an interactive elisp shell.

    Jeremy.
  • Selwyn at Apr 22, 2003 at 10:25 am
    Perhaps you need to add C:\Python22 to the PATH environment variable.
    Doh! Works like a charm.

    Thanks for your help :-)

    Selwyn.
  • Lexy Zhitenev at Apr 22, 2003 at 9:25 am
    "selwyn" <selwyn at home.net.nz> wrote in message:
    news:V65pa.4289$AB5.573029 at news02.tsnz.net...
    system: win98
    python version 2.2.2
    emacs 21.2.1
    ..........
    hi all, <snip>
    My .emacs file is as follows:

    (setq load-path (cons "C:\Python22" load-path))

    Not sure about ELisp, but try to use escaped backslash:

    (setq load-path (cons "C:\\Python22" load-path))


    Regards, Lexy
  • Selwyn at Apr 22, 2003 at 10:11 am

    Lexy Zhitenev wrote:
    "selwyn" <selwyn at home.net.nz> wrote in message:
    news:V65pa.4289$AB5.573029 at news02.tsnz.net...
    system: win98
    python version 2.2.2
    emacs 21.2.1
    ..........
    hi all,

    <snip>
    My .emacs file is as follows:

    (setq load-path (cons "C:\Python22" load-path))


    Not sure about ELisp, but try to use escaped backslash:

    (setq load-path (cons "C:\\Python22" load-path))


    Regards, Lexy
    cheers for the advice.
    however it doesn't seem to help my problem- Emacs seems to be able to
    find the python-mode.elc ok, as evidenced by the syntax highlighting
    working...

    cheers again,
    Selwyn
  • Anand B Pillai at Apr 25, 2003 at 12:08 pm
    I think you got it wrong there. Emacs uses 'load-path'
    for looking up lisp packages only. For setting the path
    to executables like python.exe, you need to set the 'exec-path'
    variable.

    ;; in your .emacs file
    (add-to-list 'exec-path "C:\\Python22")

    If you do this, you need not modify the PATH
    variable also.

    ABP

    selwyn <selwyn at home.net.nz> wrote in message news:<Kq8pa.4362$AB5.585892 at news02.tsnz.net>...
    Lexy Zhitenev wrote:
    "selwyn" <selwyn at home.net.nz> wrote in message:
    news:V65pa.4289$AB5.573029 at news02.tsnz.net...
    system: win98
    python version 2.2.2
    emacs 21.2.1
    ..........
    hi all,

    <snip>
    My .emacs file is as follows:

    (setq load-path (cons "C:\Python22" load-path))


    Not sure about ELisp, but try to use escaped backslash:

    (setq load-path (cons "C:\\Python22" load-path))


    Regards, Lexy
    cheers for the advice.
    however it doesn't seem to help my problem- Emacs seems to be able to
    find the python-mode.elc ok, as evidenced by the syntax highlighting
    working...

    cheers again,
    Selwyn

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedApr 22, '03 at 6:25a
activeApr 25, '03 at 12:08p
posts6
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase