Skip to content
vit edited this page Jul 18, 2022 · 7 revisions

eflanigan00 way

Python requirements

I started with Anaconda3-4.2.0 and had to install the following:

pip install sexpdata-0.0.3.tar.gz
pip install epc-0.0.5.tar.gz
pip install virtualenv-15.1.0.tar.gz

Starting

Run jedi:start-server then add this to your Emacs configuration file and restart emacs:

(setq jedi:environment-virtualenv (list (expand-file-name "~/.emacs.d/.python-environments/")))

jedi:show-setup provides jedi setup information

use-package

(use-package company-jedi             ;;; company-mode completion back-end for Python JEDI
  :config
  (setq jedi:environment-virtualenv (list (expand-file-name "~/.emacs.d/.python-environments/")))
  (add-hook 'python-mode-hook 'jedi:setup)
  (setq jedi:complete-on-dot t)
  (setq jedi:use-shortcuts t)
  (defun config/enable-company-jedi ()
    (add-to-list 'company-backends 'company-jedi))
  (add-hook 'python-mode-hook 'config/enable-company-jedi))

Anoncheg1 way

  1. M-x install-packages company-jedi
  2. install requirements for jedi-core according to https://github.com/tkf/emacs-jedi/wiki
  3. configure .emacs:
(add-hook 'python-mode-hook 'jedi:setup)
(add-hook 'python-mode-hook 'company-mode)

(with-eval-after-load 'jedi-core
  (setq jedi:environment-virtualenv (list (expand-file-name "/home/user/.local/lib/python3.10/site-packages")))

  (setq jedi:complete-on-dot t)
  (setq jedi:use-shortcuts t)
  ;; my
  (setq jedi:get-in-function-call-timeout 0
    jedi:get-in-function-call-delay   0
    jedi:goto-definition-config    '((nil definition nil))
    )
  (add-to-list 'company-backends 'company-jedi)
  )
Clone this wiki locally