5

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!

wombatp
  • 813
  • 4
  • 10
  • 14
  • I had some trouble setting up too. Turns out I had to install the Python code too: `sudo apt-get install virtualenv pip` and `sudo pip install jedi epc`. – abo-abo Nov 18 '13 at 07:33

1 Answers1

3

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.

Community
  • 1
  • 1
William Denman
  • 3,046
  • 32
  • 34
  • I've edited my question, I'm using ubuntu 12.04, I've tried to paste those lines in the ~/.emacs , but they still report me some errors as soon as I start tipying any python code. – wombatp Nov 17 '13 at 21:28
  • er-process-buffer RET" to see full traceback:Traceback (most recent call last):File "/home/prst/.emacs.d/elpa/jedi-20130714.1415/jediepcserver.py", line 315, in main()File "/home/prst/.emacs.d/elpa/jedi-20130714.1415/jediepcserver.py", line 311, in main)user-error: Minibuffer window is not active it shows me this error when I type any code. – wombatp Nov 17 '13 at 22:10
  • Try running this command and what the result is (if there is a traceback) `M-! python PATH/TO/jediepcserver.py --help RET` – William Denman Nov 17 '13 at 22:42