数か月前に emacs-jedi をインストールしましたが、非常にうまく機能しました。Pythonプロジェクトなしでしばらくした後、私は戻ってきました(emacs 26へのアップデートとemacs-jediの再インストールで)、問題があります:
emacs を起動すると、jedi は正常に動作します。しかし、実行するとすぐにM-x pyvenv-workon some_python3_venv
、ジェダイは機能しなくなります。私は恐ろしいエラーを受け取ります(そしてもちろん私はしようとしましたjedi:install-server
):
Error (jedi):
================================
Failed to start Jedi EPC server.
================================
*** EPC Error ***
Server may raise an error. Use "M-x epc:pop-to-last-server-process-buffer RET" to see full traceback:
No handlers could be found for logger "jediepcserver"
*** EPC Server Output (last 10 lines) ***
No handlers could be found for logger "jediepcserver"
*** EPC Server Config ***
Server arguments: ("/home/me/.emacs.d/.python-environments/default/bin/jediepcserver" "--virtual-env" "/home/me/.virtualenvs/some_project")
Actual command: /home/me/.emacs.d/.python-environments/default/bin/jediepcserver
VIRTUAL_ENV envvar: "/home/me/.virtualenvs/some_project"
*** jedi-mode is disabled in #<buffer algorithms.py> ***
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.
「新たなスタートの後に良い」ケースでは、これをjedi:show-setup-info
教えてくれます:
;; Emacs Lisp version:
(:emacs-version "26.1" :jedi-version "0.2.7" :python-environment-version "0.0.2alpha0")
;; Python version:
((:version "2.7.16 (default, Apr 6 2019, 01:42:57) \n[GCC 8.3.0]" :name "sys" :file nil)
(:version "0.13.3" :name "jedi" :file "/home/me/.emacs.d/.python-environments/default/local/lib/python2.7/site-packages/jedi/__init__.pyc")
(:version "0.0.5" :name "epc" :file "/home/me/.emacs.d/.python-environments/default/local/lib/python2.7/site-packages/epc/__init__.pyc")
(:version "0.0.3" :name "sexpdata" :file "/home/me/.emacs.d/.python-environments/default/local/lib/python2.7/site-packages/sexpdata.pyc"))
;; Command line:
(:virtualenv "/usr/bin/virtualenv" :virtualenv-version "15.1.0\n")
;; Customization:
((jedi:complete-on-dot)
(jedi:doc-display-buffer . display-buffer)
(jedi:doc-hook view-mode)
(jedi:doc-mode . rst-mode)
(jedi:environment-root)
(jedi:environment-virtualenv)
(jedi:get-in-function-call-delay . 1000)
(jedi:get-in-function-call-timeout . 3000)
(jedi:goto-definition-config
(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-imenu)
(jedi:install-python-jedi-dev-command "pip" "install" "--upgrade" "git+https://github.com/davidhalter/jedi.git@master#egg=jedi")
(jedi:key-complete .
[C-tab])
(jedi:key-goto-definition .
[67108910])
(jedi:key-goto-definition-pop-marker .
[67108908])
(jedi:key-related-names . "r")
(jedi:key-show-doc . "d")
(jedi:server-args)
(jedi:server-command "/home/me/.emacs.d/.python-environments/default/bin/jediepcserver")
(jedi:setup-keys)
(jedi:tooltip-method)
(jedi:use-shortcuts)
(python-environment-default-root-name . "default")
(python-environment-directory . "~/.emacs.d/.python-environments")
(python-environment-virtualenv "virtualenv" "--system-site-packages" "--quiet"))
を実行した後M-x pyvenv-workon
、ほぼ同じ出力が得られますが、セクションに;; Python version:
エラーが表示されます。
;; Emacs Lisp version:
(:emacs-version "26.1" :jedi-version "0.2.7" :python-environment-version "0.0.2alpha0")
;; Python version:
nil
;; EPC error:
(:get-epc-error
(wrong-type-argument epc:manager nil))
プロジェクトに必要な virtualenv と一緒に emacs-jedi を実行するにはどうすればよいですか? をカスタマイズしようとしましjedi:server-args
たが、役に立ちませんでした。