tkf / emacs-jedi

Python auto-completion for Emacs
http://tkf.github.io/emacs-jedi/latest/
666 stars 89 forks source link

autocomplete numpy, sympy #119

Open xin-jin opened 10 years ago

xin-jin commented 10 years ago

I am running emacs24+python3 on Debian testing. I installed jedi via package.el.

I faced the same situation as in http://stackoverflow.com/questions/14708453/emacs-jedi-does-not-find-numpy-completions

But I am still not able to get it right. Here are my configurations related to jedi:

(require 'auto-complete)
(require 'jedi)
(setq jedi:server-command (list "/usr/bin/python3" jedi:server-script))
(ac-linum-workaround)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:server-args
      '("--sys-path" "/usr/lib/python3/dist-packages"
        "--sys-path" "/usr/local/lib/python3.3/dist-packages"))
(setq jedi:setup-keys t)                      ; optional
(setq jedi:complete-on-dot t)                 ; optional

I also tried the virtualenv method (make PYTHON=python3 requirements) but the result is the same.

Thanks!

xin-jin commented 10 years ago

But everything else works fine. For example, when I type "x = sympy.sym", it can complete "x = sympy.symbols". Is it normal?

Dronte commented 10 years ago

I did not check that, but try to put (require 'jedi) line below the line where you set server args.

xin-jin commented 10 years ago

Thank you for your reply, Dronte. But it does not seem to work. My current setting:

(require 'auto-complete)
(setq jedi:server-args
      '("--sys-path" "/usr/lib/python3/dist-packages"
        "--sys-path" "/usr/local/lib/python3.3/dist-packages"))
(require 'jedi)
(setq jedi:server-command (list "/usr/bin/python3" jedi:server-script))
(ac-linum-workaround)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:setup-keys t)                      ; optional
(setq jedi:complete-on-dot t)                 ; optional 
fedeinthemix commented 10 years ago

I have the same problem: with numpy and scipy I don't get function suggestions and doc. Works fine with other libraries such as, e.g., "os".

I'm using jedi 0.8.0 jedi.el 0.2.0alpha2 epc 0.05

My jedi.el configuration is

(setq jedi:server-command '("c:/Anaconda/Scripts/jediepcserver.exe")) (add-hook 'python-mode-hook 'jedi:setup) (setq jedi:complete-on-dot t)

Note that I'm using the Anaconda python distribution on Windows 7 and have installed jediepcserver manually with pip install /path to jedi/

syohex commented 10 years ago

I suppose this is jedi issue.

https://github.com/davidhalter/jedi/issues/372