Korey Hinton
Korey Hinton

Reputation: 2562

Emacs Jedi python tool unable to load "error searching for program: permission denied, python"?

I get the following error when I try to open a python file in emacs:

can’t guess python indent offset, using defaults: 4

deferred error: (error searching for program: permission denied, python)

My assumption is that the python environment variable needs to be copied to the Emacs PATH variable, because I had to do the same thing for Mac OS X by using bradleywright's path.el script but now I need to do the same thing for Windows 7. How can I do this?

init.el

(load "~/.emacs.d/path.el")

(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)


(require 'jedi)
(setq jedi:server-command
  (list "C:/Python33/python.exe" jedi:server-script))

(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)   

(global-auto-complete-mode t)

(require 'ido)
(ido-mode t)

(add-to-list 'load-path "~/.emacs.d/elpa/magit-1.2.0/magit.el")
(require 'magit)

(require 'linum)
(global-linum-mode 1)

Upvotes: 2

Views: 1834

Answers (3)

Korey Hinton
Korey Hinton

Reputation: 2562

Restarting* my computer fixed this error:

deferred error: (error searching for program: permission denied, python)

*This was my first restart since installing Python.

Everything seems to be working fine now, I still get the can’t guess python indent offset, using defaults: 4 error but jedi tab-completion is working fine.

Thanks for everyone's suggestions, it certainly helped!

Upvotes: 0

tkf
tkf

Reputation: 3020

Open Python and get the full path to Python using sys.executable:

>>> import sys
>>> sys.executable

And then set jedi:server-command like this:

(setq jedi:server-command
      (list "THE-PATH-YOU-GOT" jedi:server-script))

see also: http://tkf.github.io/emacs-jedi/latest/#jedi:server-command

Note that you need to install Python modules (i.e., epc and jedi) and they should be importable for this Python. So make sure that this works in your Python:

>>> import epc, jedi

Upvotes: 2

Andreas Röhler
Andreas Röhler

Reputation: 4804

Look for a "deferred.el". Exist two functions inside which raise that error. Running them under edebug should reveal the cause.

Upvotes: 1

Related Questions