Recently my Emacs/Python setup stopped working as it had done previously without any problem.

I have the following defining where my virtual environments are in my init files...

(setq venv-location (expand-file-name "~/.virtualenvs"))
(setq python-environment-directory venv-location)
(add-hook 'python-mode-hook 'jedi:setup)

...and a few virtual environments exist...

 l ~/.virtualenvs 
total 76K
drwxr-xr-x  7 neil domain users 4.0K Jul 26 11:23 .
drwxr-xr-x 61 neil domain users 4.0K Jul 26 12:00 ..
drwxr-xr-x  5 neil domain users 4.0K Jul 26 11:23 default
drwxr-xr-x  8 neil domain users 4.0K Jun 18 15:45 dlg2019
drwxr-xr-x  6 neil domain users 4.0K Jul 15 12:21 dsbase201907
drwxr-xr-x  8 neil domain users 4.0K Mar 27 12:00 dskit2019
drwxr-xr-x  9 neil domain users 4.0K Mar 25 14:03 dskit-dev
-rwxr-xr-x  1 neil domain users  138 Jan 24  2019 get_env_details
-rw-r--r--  1 neil domain users   99 Jan 24  2019 initialize
-rw-r--r--  1 neil domain users   76 Jan 24  2019 postactivate
-rw-r--r--  1 neil domain users   78 Jan 24  2019 postdeactivate
-rwxr-xr-x  1 neil domain users   69 Jan 24  2019 postmkproject
-rw-r--r--  1 neil domain users   76 Jan 24  2019 postmkvirtualenv
-rwxr-xr-x  1 neil domain users  113 Jan 24  2019 postrmvirtualenv
-rwxr-xr-x  1 neil domain users  102 Jan 24  2019 preactivate
-rw-r--r--  1 neil domain users   79 Jan 24  2019 predeactivate
-rwxr-xr-x  1 neil domain users   94 Jan 24  2019 premkproject
-rwxr-xr-x  1 neil domain users  133 Jan 24  2019 premkvirtualenv
-rwxr-xr-x  1 neil domain users  114 Jan 24  2019 prermvirtualenv

I have my *scartch* set to be a Python buffer and on starting Emacs I'm now informed...

Error (jedi):
Failed to start Jedi EPC server.

*** EPC Error ***
make client process failed

*** EPC Server Config ***
Server arguments: ("/home/neil/.virtualenvs/default/bin/jediepcserver")
Actual command: /home/neil/.virtualenvs/default/bin/jediepcserver
VIRTUAL_ENV envvar: "/home/neil/.virtualenvs/dskit2019"

*** jedi-mode is disabled in #<buffer *scratch*> ***
Fix the problem and re-enable it.

*** You may need to run "M-x jedi:install-server". ***
This could solve the problem especially if you haven't run the command yet
since Jedi.el installation or update and if the server complains about
Python module imports.

and I'm told deferred error : (wrong-type-argument arrayp nil)

I duly run M-x jedi:install-server and it runs pip install --upgrade /home/neil/.emacs.d/elpa/jedi-core-2019-62-.1820/ and nothing I still get the same error.

Output of M-x jedi:show-setup-info is...

;; Emacs Lisp version:
(:emacs-version "26.2" :jedi-version "0.2.7" :python-environment-version "0.0.2alpha0")
;; Python version:
;; EPC error:
 (wrong-type-argument arrayp nil))
;; Command line:
(:virtualenv "/home/neil/.virtualenvs/dskit2019/bin/virtualenv" :virtualenv-version "16.6.0\n")
;; Customization:
 (jedi:doc-display-buffer . display-buffer)
 (jedi:doc-hook view-mode)
 (jedi:doc-mode . rst-mode)
 (jedi:get-in-function-call-delay . 1000)
 (jedi:get-in-function-call-timeout . 3000)
  (nil nil nil)
  (t nil nil)
  (nil definition nil)
  (t definition nil)
  (nil nil t)
  (t nil t)
  (nil definition t)
  (t definition t))
 (jedi:goto-definition-marker-ring-length . 16)
 (jedi:imenu-create-index-function . jedi:create-nested-imenu-index)
 (jedi:import-python-el-settings . t)
 (jedi:install-python-jedi-dev-command "pip" "install" "--upgrade" "git+https://github.com/davidhalter/jedi.git@master#egg=jedi")
 (jedi:key-complete .
 (jedi:key-goto-definition .
 (jedi:key-goto-definition-pop-marker .
 (jedi:key-related-names . "r")
 (jedi:key-show-doc . "d")
 (jedi:server-command "/home/neil/.virtualenvs/default/bin/jediepcserver")
 (jedi:tooltip-method pos-tip popup)
 (python-environment-default-root-name . "default")
 (python-environment-directory . "/home/neil/.virtualenvs")
 (python-environment-virtualenv "virtualenv" "--system-site-packages" "--quiet"))

Other things I've tried...

  • byte-compiling jedi and epc
  • uninstalling and reinstalling jedi and epc

...to no avail. Completely stumped as I've no idea what to try next.

Pointers welcome and happy to provide more information if required.

EDIT 2019-08-20 : I've tried the suggestions in this issue but without success.

  • Possible solution is not to explicitly load jedi as a hook to python-mode and instead set jedi as the rpc backend as suggested here. Giving it a whirl, so far I don't encounter the Jedi/EPC error above \o/ – slackline Aug 31 '19 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.