looking for help in configuring .emacs file for python (python.el),

290 views Asked by At

My emacs version is 24.5, using in built python. I have written these lines in my .emacs for it:

(require 'python)
(setq python-shell-interpreter "C:/Python34")

The problem is none of the commands (when I am trying to run test.py) are working. I have tried several commands named like

M-x python-shell-*

and they all return

"wrong type argument:arrayp, nil".

What I am doing wrong? What am I supposed to do? What should be ideal configuration (.emacs)?

Further info:

  • Python 3.4 installed at C:/
  • Emacs at C:/Program Files/
  • $HOME is C:/user/akk/appdata/roaming/
2

There are 2 answers

0
Chris On BEST ANSWER

That variable is for the Python interpreter, not the Python directory.

I don't have a Windows machine to test on, but if you update your configuration to point to the actual binary (possibly C:/Python34/python.exe?) you should find that it works.

0
tanzoniteblack On

According to the mode documentation in the top of python.el, you can set this on windows like (change Python27 to Python34 for your use case:

(setq python-shell-interpreter "C:\\Python27\\python.exe")