wombatp
wombatp

Reputation: 833

emacs jedi doesn't work

I'm trying to find the solution for days, but I didn't get it yet. So, if you guys could help me I'd appreciate it. I've been using emacs to code in Python, I'm a very beginner using emacs, so, I decided to install the autocomplete Jedi feature. In some tutorials I've found they ask me to add this line in the ./emacs file (add-hook 'python-mode-hook 'auto-complete-mode) (add-hook 'python-mode-hook 'jedi:ac-setup)

I add those lines in the file and restart Emacs, however when I open some .py file they report me some errors. ps. I've installed Jedi through the Melpa package! ps. I'm using Ubuntu 12.04

Thanks in advance!

Upvotes: 5

Views: 2382

Answers (1)

William Denman
William Denman

Reputation: 3154

A good idea when asking a question when it relates to Emacs, is specifying what operating system you are using as the solution might be OSX/Linux centric vs Windows. As well you might want to post specific error messages.

You have to enter those lines in your emacs configuration file, which on Linux/OSX would be in ~/.emacs. The tilde meaning your home folder. You can also put your emacs configuration in ~/.emacs.d/init.el.

Without your question being more specific, all I can say is that I use the el-get package manager to install jedi. And use the following in my configuration to get things working.

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

Also make sure you have your PYTHONPATH environment variable setup correctly. You would put something like export $PYTHONPATH=/path/to/python/libraries in your ~/.bashrc. This would only be necessary if you installed your python modules in a non-standard place.

See for instance, Emacs deferred errors for similar errors to what you are getting.

Upvotes: 3

Related Questions