Closed silgon closed 8 years ago
Python version?
Python 2.7.6
Update: in a desperate measure I uninstalled and reinstalled anaconda-mode
and now it's worse I think. The same code:
import numpy as np
np.
It gives me the next error now:
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 68, in <module>
import os
File "/usr/lib/python2.7/os.py", line 398, in <module>
import UserDict
File "/usr/lib/python2.7/UserDict.py", line 83, in <module>
import _abcoll
File "/usr/lib/python2.7/_abcoll.py", line 11, in <module>
from abc import ABCMeta, abstractmethod
File "abc.py", line 7
jedi.
^
SyntaxError: invalid syntax
But jedi it's installed. As a note, I installed anaconda-mode
from the melpa repositories.
Can't reproduce it.
python 2.7.10
I'm still getting the error from the Updated message when I reinstalled. I'm trying to get it to work. I cannot figure out the problem. I'll keep you posted. Let me know if you have some ideas :/
Last error message apparently was generated because a debug file I created. Ok. I reinstalled everything. So, now what happens is that the first time it tries to autocomplete, it does it well, as follows: The problem is the second time (who knows why) the problem that I described at first appears: And then it doesn't complete anymore.
You can see the whole error message here: http://paste.ubuntu.com/12530749/ (it's pretty long to be displayed here)
It's look familiar to some problems in the json-rpc
library. Python2 http server send \r\n separator not quiet right. ^M characters may confuse json parser. Try to use python 2.7.10 and say if error disappears.
I don't want to mess up the configuration of my computer installing stuff in /usr/bin. I will check with another computer later, to see if I have the same problem :/
Looks similar to #122 reported on python 2.7.10
Yeah, it looks similar. Thanks @gillescharron.
@proofit404 Question about json-rpc
, I double checked uninstalling my version of json-rpc
with pip
and also the json-rpc
package of emacs, and anaconda is still working. So, as far I understand anaconda-mode
has it inside the package isn't it? (I didn't find it inside anaconda-mode folder though)
@gillescharron or @proofit404 do you know how to go back in the melpa installation just to give it a try? because this error didn't happen before and I've been using anaconda-mode for some time already =)
No idea how to rollback. Never do this before. Also you can do following experiment: go into *anaconda-response*
buffer, put point on the beginnig of the last line right before first {
character. Evaluate following snippet interactively M-: (json-read) RET
. If it cause error remove all ^M
characters from buffer and repeat first step.
This is the response:
((result . [(... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) ...]) (id . 1) (jsonrpc . "2.0"))
I don't know what it means but it cannot be good I think.....
In other matters: I'm in another computer with the old installation. Same configuration with python and it's working fine. It depends on the json-rpc
and it's working fine.
anaconda-mode
doesn't use json-rpc
library any more because it provides synchronous api only. Currently anaconda-mode
work asynchronously with python server. I mention this library because I has similar issue in early days with it.
Also your json-read
test point me dirrectly into problem. url
package can't detect response body start position properly. Can you reproduce same test but put your point before ^M
char?
Same response:
((result . [(... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ...) ...]) (id . 1) (jsonrpc . "2.0"))
Hmm. I'll add logging of point possition. It must show us more.
hi, I have the same problem , python version 2.7.6
By the way, this is used as the python-mode layer in spacemacs.
@xylonxu Do you use http proxy?
@proofit404 oh no, thanks, that's the problem....
@xylonxu add 127.0.0.1 to the no_proxy
environment variable.
I'm seeing this too. I'm getting anaconda-mode via the Python layer in spacemacs.
Environment:
The same problem here ("error in process sentinel: Can't read anaconda-mode server response")
Any ideas how to fix it? I don't use any proxy.
@tkossak @royseto can you guys post *anaconda-mode*
and *anaconda-response*
buffers content?
anaconda-response:
HTTP/1.1 200 OK
Server: BaseHTTP/0.3 Python/2.7.6
Date: Wed, 14 Oct 2015 18:48:47 GMT
Content-Length: 85
{"jsonrpc": "2.0", "id": 1, "result": {"index": 0, "params": ["x=0"], "name": "int"}}
anaconda-mode:
anaconda_mode port 9000
Thank you.
btw. i didn't have this problem before reinstalling my Linux Mint, it only happens now after fresh installation.
anaconda-response:
HTTP/1.1 200 OK
Server: BaseHTTP/0.3 Python/2.7.6
Date: Thu, 15 Oct 2015 05:26:25 GMT
Content-Length: 43
{"jsonrpc": "2.0", "id": 1, "result": null}
Note that the line termination in the anaconda-response buffer is Windows-style CRLF even though I am working on Ubuntu Linux 14.04.
anaconda-mode:
anaconda_mode port 9000
Thanks for your help.
Looks like a problem with older python http server.
Can we fix it ourselves? Maybe changing python2 to python3 somewhere?
(setq python-shell-interpreter "python3")
This code snippet will change python used by emacs and anaconda-mode. You can try to do this if changing python version is an option for your project.
Also you can try latest python2 version (2.7.10
for example).
@proofit404 are you referring to the BaseHTTPServer that you import into service_factory here? https://github.com/proofit404/service-factory/blob/master/service_factory/providers/basehttp.py
What behavior from older versions of that package is causing this issue?
I'm on Python 2.7.6 because it's the default that comes with Ubuntu 14.04 and my main project is python2 based.
Thanks!
@royseto yes I mean BaseHTTPServer
. I suspect Emacs may be confused with ^M
and don't detect http response body beginning position correctly.
(setq python-shell-interpreter "python3") This code snippet will change python used by emacs and anaconda-mode. You can try to do this if changing python version is an option for your project.
@proofit404 I added this to my dotspacemacs/config but the problem with anaconda persists. I noticed that as soon as i open python file the variable is changed to "ipython".
I suppose spacemacs add a function to the python-mode-hook
which change this variable.
@proofit404 please ignore f9eeff5, and review the 8c8559b
@wangchen What is the difference between those commits? :smile:
@proofit404 awkward...
similar problem
emacs 24.5, python 2.7.10, 'no_proxy' set
It seems some request cannot be found.
CDN is set 8.8.8.8
@lufeihaidao what are the values of http_proxy
, https_proxy
and no_proxy
variables?
@proofit404
url-proxy-services is a variable defined in `url-vars.el'.
Its value is (("no_proxy" . "\\(localhost\\|127\\.0\\.0\\.1\\)"))
Original value was nil
@lufeihaidao Looks fine. Can you provide *anaconda-mode*
buffer content?
HTTP/1.1 200 OK
Server: nginx/0.8.53
Date: Tue, 24 Nov 2015 02:16:29 GMT
Content-Type: text/html
Content-Length: 332
Last-Modified: Wed, 22 Jul 2015 03:31:38 GMT
Connection: keep-alive
Accept-Ranges: bytes
<!Doctype html><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<script type="text/javascript">
var h=window.location.host;
window.location="http://search.114so.cn/search_web.html?id=407&kw=
"+h;
</script>
</body></html>
On Wed, Nov 18, 2015 at 4:25 PM, Malyshev Artem notifications@github.com wrote:
@lufeihaidao https://github.com/lufeihaidao Looks fine. Can you provide anaconda-mode buffer content.
— Reply to this email directly or view it on GitHub https://github.com/proofit404/anaconda-mode/issues/124#issuecomment-157642419 .
@lufeihaidao this is content of *anaconda-response*
. I need *anaconda-mode*
buffer content.
I have this bug. Fixed by upgrade to emacs 24.5 (from 24.3, ubuntu's 14's default) python2.7.6 has no problem.
@co-dh Thanks for information! I will need to fix this bug on older emacs versions since they officially supported.
Fixed in the tramp
branch.
Hello again,
I'm having a problem since the last few days. Let's say I have a really simple code:
After some time processing for the autocompletion the next message is thrown:
And the I get a really long message from the buffer
*anaconda-response*
:Any idea of what could be causing the problem?