I just installed python-mode using melpa and therefore I must be on the latest version.

My .emacs init file consists only of the following lines :

(autoload 'python-mode "python-mode" "Python Mode." t)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))

I try to execute a program that runs fine in the terminal, but when I hit C-c C-c, ie. py-execute-buffer, there's the following error:

py-choose-shell-by-path: Wrong number of arguments: #[nil

followed by a trail of gibberish:


The command py-shell will result in the similar error message.

Emacs v24.5 OS X Yosemite 10.10.4

  • Well, when I delete compiled el files it works fine. So maybe it has something to do with the emacs compiler? I honestly have no clue how it works. – Literal Jul 21 '15 at 21:51

When encountering a bug, please report it to the maintainer, as you will be not the only one affected and it should get fixed for all.

In case of python-mode.el:


This time done: https://bugs.launchpad.net/python-mode/+bug/1476933

After looking into py-choose-shell-by-path: the lexical-let might have caused the error. Please check out current trunk, should be fixed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.