Windows 7公司绝地完成后端错误

时间:2018-10-01 19:32:24

标签: python-3.x virtualenv emacs-jedi emacs26

无法使用company和company-jedi作为完成后端来完成工作。我已经按照github上的建议通读了http://tfk.github.io/emacs-jedi/latest/#troubleshooting,并尝试了在Windows 7机器上可以做到的一切。

我根据http://tkf.github.io/emacs-jedi/latest/#how-to-get-traceback设置了回溯。

回溯输出:

Debugger entered--Lisp error: (error "Server may raise an error. Use \"M-x epc:pop-to-last-server-process-buffer RET\" to see full traceback:\n49291\015\n")
  signal(error ("Server may raise an error. Use \"M-x epc:pop-to-last-server-process-buffer RET\" to see full traceback:\n49291\015\n"))
  error("Server may raise an error. Use \"M-x epc:pop-to-last-server-process-buffer RET\" to see full traceback:\n%s" "49291\015\n")
  epc:start-server("c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe" ("--log-traceback"))
  epc:start-epc("c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe" ("--log-traceback"))
  jedi:epc--start-epc("c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe" ("--log-traceback"))
  jedi:server-pool--start(("c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe" "--log-traceback"))
  jedi:start-server()
  jedi:start-dedicated-server(("c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe" "--log-traceback"))
  funcall-interactively(jedi:start-dedicated-server ("c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe" "--log-traceback"))
  call-interactively(jedi:start-dedicated-server record nil)
  command-execute(jedi:start-dedicated-server record)
  execute-extended-command(nil "jedi:start-dedicated-server")

M-x epc:pop-to-last-server-process-buffer

输出:

49291^M

我的设置和日志:

M-x jedi:install-server

Making virtualenv at c:/Users/cmaceachern/.emacs.d/.python-environments/default...Done

Using base prefix ’c:\\python35’ New python executable in c:\Users\cmaceachern\.emacs.d\.python-environments\default\Scripts\python.exe 

Installing setuptools, pip, wheel...done. 

Running: pip install --upgrade c:/Users/cmaceachern/.emacs.d/elpa/jedi-core-0.2.7/...Done

Processing c:\users\cmaceachern\.emacs.d\elpa\jedi-core-0.2.7

Requirement already satisfied, skipping upgrade: jedi>=0.8.1 in c:\python35\lib\site-packages (from jediepcserver==0.0.0) (0.12.1) 

Requirement already satisfied, skipping upgrade: epc>=0.0.4 in c:\python35\lib\site-packages (from jediepcserver==0.0.0) (0.0.5) Collecting argparse (from jediepcserver==0.0.0)   Using cached https://files.pythonhosted.org/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl 

Requirement already satisfied, skipping upgrade: parso>=0.3.0 in c:\python35\lib\site-packages (from jedi>=0.8.1->jediepcserver==0.0.0) (0.3.1)

Requirement already satisfied, skipping upgrade: sexpdata>=0.0.3 in c:\python35\lib\site-packages (from epc>=0.0.4->jediepcserver==0.0.0) (0.0.3) 

Building wheels for collected packages: jediepcserver   
Running setup.py bdist_wheel for jediepcserver: started  
Running setup.py bdist_wheel for jediepcserver: finished with status ’done’ 
Stored in directory: C:\Users\cmaceachern\AppData\Local\pip\Cache\wheels\07\d3\df\47fb2b72aa611bc436bc44b1b034630257ea2234f756417805

Successfully built jediepcserver Installing collected packages: argparse, jediepcserver Successfully installed argparse-1.4.0 jediepcserver-0.0.0

M-x shell-command virtualenv --version
16.0.0

M-x shell-command python --version
Python 3.5.4

M-x shell-command python -c "import sys; print(sys.executable); print(sys.path)"
C:\Python35\python.exe
['', 'C:\\Python35\\python35.zip', 'C:\\Python35\\DLLs', 'C:\\Python35\\lib', 'C:\\Python35', 'C:\\Python35\\lib\\site-packages']

M-x jedi:show-setup-info

;; 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
 (error "Server may raise an error. Use \"M-x epc:pop-to-last-server-process-buffer RET\" to see full traceback:\n65036
\n"))
;; Command line:
(:virtualenv "c:/Python35/Scripts/virtualenv.exe" :virtualenv-version "16.0.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@dev#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 "c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe")
 (jedi:setup-keys)
 (jedi:tooltip-method pos-tip popup)
 (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 epc:pop-to-last-server-process-buffer

显示一个仅包含“ 65035 ^ M”的 epc:server:1 缓冲区。

  1. 在公司模式下打开python缓冲区
  2. 尝试使用以下方式手动将jedi作为完成后端启动:

    M-x公司-后端-公司-绝地

结果:

Error (jedi): Failed to start Jedi EPC server.
*** 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.

Debugger entered--Lisp error: (error "Server may raise an error. Use \"M-x epc:pop-to-last-server-process-buffer RET\" to see full traceback:\n64774\015\n")
  signal(error ("Server may raise an error. Use \"M-x epc:pop-to-last-server-process-buffer RET\" to see full traceback:\n64774\015\n"))
  error("Server may raise an error. Use \"M-x epc:pop-to-last-server-process-buffer RET\" to see full traceback:\n%s" "64774\015\n")
  epc:start-server("c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe" nil)
  epc:start-epc("c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe" nil)
  jedi:epc--start-epc("c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe" nil)
  jedi:server-pool--start(("c:/Users/cmaceachern/.emacs.d/.python-environments/default/Scripts/jediepcserver.exe"))
  jedi:start-server()
  jedi:get-epc()
  jedi:call-deferred(complete)
  company-jedi-candidates(#f(compiled-function (candidates) #<bytecode 0x1b959fd>))
  company--fetch-candidates(#("im" 0 2 (fontified t)))
  company-calculate-candidates(#("im" 0 2 (fontified t)))
  company--begin-new()
  company--perform()
  company-auto-begin()
  company-idle-begin(#<buffer main.py> #<window 3 on main.py> 376 13)
  apply(company-idle-begin (#<buffer main.py> #<window 3 on main.py> 376 13))
  timer-event-handler([t 23474 25839 847702 nil company-idle-begin (#<buffer main.py> #<window 3 on main.py> 376 13) nil 0])

0 个答案:

没有答案