Python Shell in Emacs 24?

Question:

I recently upgraded from Emacs 23 to Emacs 24. Since the upgrade, it seems that I’ve lost the ability to call “M-x python-shell” (!).

What happened? Does the included python mode no longer ship with this functionality?

Using Emacs 23:

○ /usr/local/bin/emacs -Q

Describe function: python-shell
    python-shell is an interactive autoloaded Lisp function in
    `python.el'.

Using Emacs 24:

○ /Applications/Emacs.app/Contents/MacOS/Emacs -Q

Describe function: python-shell [No match]
Asked By: Dan Jaouen

||

Answers:

It seems like you only solved the python-mode issue. As to M-x-python-shell you can also get this by doing M-x-run-python. If it says directory not found its because the the python variable is not pointing to the correct path. So do C-h-f run-python then it will tell you that run-python’s value is python-shell-interpreter. So then point it to python.exe in your python folder.

add this to your .emacs file

(setq python-shell-interpreter "path to python.exe")

Then like in emacs 23 you can do C-c-C-c to run a .py file.

edit-the reason i have all of this here even though you may already of known this is because i didnt realize that emacs24 changed the python value for run-python for a while and this is how i fixed it. 😀

Answered By: Shantanu
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.