pythonic-emacs / anaconda-mode

Code navigation, documentation lookup and completion for Python.
GNU General Public License v3.0
706 stars 87 forks source link

Cannot read anaconda-mode server response #390

Open nanounanue opened 4 years ago

nanounanue commented 4 years ago

NOTE: I know that another issue (#360 ) has the same title, but apparently is a different error.

I am running GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.12) of 2020-04-11, and anaconda-mode from melpa

anaconda-mode is configured as follows:

(use-package anaconda-mode
  :init
  (add-hook 'python-mode-hook 'anaconda-mode)
  (add-hook 'python-mode-hook 'anaconda-eldoc-mode)
  (add-hook 'python-mode-hook 'display-line-numbers-mode))

The *anaconda-mode* buffer displays:

anaconda_mode port 36723

and the anaconda-response shows

# status: (:error (error connection-failed deleted
 :host 127.0.0.1 :service 36723) :error (error connection-failed failed with code 110
 :host 127.0.0.1 :service 36723))
# point: 1

I am editing local files, inside a virtualenv What I am doing wrong?

CeleritasCelery commented 4 years ago

The variable anaconda-mode-server-command contains the script that is run. It takes 3 CLI arguments. These would be ~/emacs.d/anaconda-mode/0.1.13 127.0.0.1 "" if you are using the defaults on local files. See if you can run the script to start the server on the command line (you will need to copy it to a file).

nanounanue commented 4 years ago

How are those arguments created?

I forgot to mention but I am using pyenv and the installation of anaconda-mode is handled by straight.el

CeleritasCelery commented 4 years ago

They are created here

https://github.com/pythonic-emacs/anaconda-mode/blob/6094dedf77810a47e213738f7e39a077de575ce1/anaconda-mode.el#L390-L396

clwgg commented 3 years ago

@nanounanue did you find a solution for this? I am experiencing very similar behavior. Weirdly, anaconda-mode seems to be working initially when I start up emacs, but stops working soon after with a similar message in the *anaconda-response* buffer:

# status: (:error (error connection-failed deleted
 :host 127.0.0.1 :service 44197) :error (error connection-failed failed with code 110
 :host 127.0.0.1 :service 44197))
# point: 1

I am also working on local files with a virtualenv activated through pyvenv, on emacs 27.1 and python 3.7.5.

clwgg commented 3 years ago

Unfortunately this problem is persisting for me, and I haven't been able to figure out what is causing it. Are there any ideas on how to debug this? Also, could someone point me to the best way to restart the anaconda server without having to restart emacs altogether? That way, I could at least make it work again once the error message pops up. Thank you!

NightMachinery commented 3 years ago

I get this error when I try to use anaconda-mode on a remote, tramp file. Is some setup required on the remote side?

# status: (:error (error connection-failed deleted
 :host 127.0.0.1 :service 38525) :error (error connection-failed failed with code 61
 :host 127.0.0.1 :service 38525))
# point: 1

BTW, I am happy just to get dabbrev completions when anaconda fails, but I lose everything.