It is a random issue.
Most probable scenario to recreate:
# Mandatory:
atomicwrites >=1.2.0 : 1.4.0 (OK)
chardet >=2.0.0 : 3.0.4 (OK)
cloudpickle >=0.5.0 : 1.4.1 (OK)
diff_match_patch >=20181111 : 20181111 (OK)
intervaltree : None (OK)
IPython >=4.0 : 7.13.0 (OK)
jedi =0.15.2 : 0.15.2 (OK)
nbconvert >=4.0 : 5.6.1 (OK)
numpydoc >=0.6.0 : 0.9.2 (OK)
paramiko >=2.4.0 : 2.7.1 (OK)
parso =0.5.2 : 0.5.2 (OK)
pexpect >=4.4.0 : 4.8.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.7.0 (OK)
pygments >=2.0 : 2.6.1 (OK)
pylint >=0.25 : 2.5.2 (OK)
pyls >=0.31.9;<0.32.0 : 0.31.10 (OK)
qdarkstyle >=2.8 : 2.8.1 (OK)
qtawesome >=0.5.7 : 0.7.0 (OK)
qtconsole >=4.6.0 : 4.7.4 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
rtree >=0.8.3 : 0.9.4 (OK)
sphinx >=0.6.6 : 3.0.4 (OK)
spyder_kernels >=1.9.1;<1.10.0 : 1.9.1 (OK)
watchdog : None (OK)
zmq >=17 : 18.1.1 (OK)
# Optional:
cython >=0.21 : 0.29.17 (OK)
matplotlib >=2.0.0 : 3.1.3 (OK)
numpy >=1.7 : 1.18.1 (OK)
pandas >=0.13.1 : 1.0.3 (OK)
scipy >=0.17.0 : 1.4.1 (OK)
sympy >=0.7.3 : 1.5.1 (OK)
Hi @dasdebashish17 what do you see in the status bar of the LSP? Maybe the LSP stopped working. Could you try restarting the LSP with the Restart Python Language Server
option?
Let us know if you find out a way to consistently reproduce your issue or any more info in order to understand what could be causing it and off course if restarting the LSP helps as a workaround for now :)
Thanks for the update.
Will check and let you know.
Hi,
These are my observations.
Re-starting Python LSP seems to do the job.
But Python LSP always shows status 'Ready'. It will be better to have an indication to the user that Python LSP has stopped working and needs to be re-started. Also, as I keep facing this issue frequently (atleast once every 30 mins), there can be a provision to auto-refresh Python LSP so that the user need not have to bother about doing it manually.
One more observation is ""Code editing sometimes become slow after the upgrade of Spyder
Thanks for the info @dasdebashish17 !
Do you guys know if there is any related issue @andfoy @ccordoba12 with the description of behavior provided by @dasdebashish17 ?
I think that some improvements have been done for the LSP for 4.1.4, but I'm unsure if they could be related with this one
But Python LSP always shows status 'Ready'. It will be better to have an indication to the user that Python LSP has stopped working and needs to be re-started.
Thanks for your patience @dasdebashish17 about this. This problem should be fixed now and it'll be part of our 4.1.4 version, to be released next week.
If the problem reappears, please open a new issue about it.
Hello,
I'm still having this issue with the tab completion not working. I tried "Restarting Python Language Server" and that did not fix it. It was working previously when I was using version 3.3.6
Thanks in advance for your help
Hello,
From past 2 days, the auto-completion doesn't work irrespective of how many times I restart Python Language Server, Spyder, my laptop etc... Not Sure why.
Regards,
Debashish
Hi @luigi741 and @dasdebashish17 sorry to hear that, could you run Spyder from the terminal/console with the flag debug-info verbose
(something like spyder --debug-info verbose
) and upload here the logs you can get? Thanks!
Hi @dalthviz .
When I use the command spyder --debug-info verbose
, I could see some information over console. But not sure which logs you would need. Could you please elaborate on that. (I have provided the console display into a log file and provided as an attachment.)
spyder_error_dump.txt
Thanks.
Thanks @dasdebashish17 that's what I meaned when refereing to the logs. Checking them seems like there is a point when an error raises with the pyls/jedi:
python Response error:
{'code': -32602,
'message': "TypeError: 'NoneType' object is not callable",
'data': {
'traceback': [
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pyls_jsonrpc\\endpoint.py", line 113, in consume\n self._handle_request(message[\'id\'], message[\'method\'], message.get(\'params\'))\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pyls_jsonrpc\\endpoint.py", line 182, in _handle_request\n handler_result = handler(params)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pyls_jsonrpc\\dispatchers.py", line 23, in handler\n return method(**(params or {}))\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pyls\\python_ls.py", line 321, in m_text_document__completion\n return self.completions(textDocument[\'uri\'], position)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pyls\\python_ls.py", line 239, in completions\n completions = self._hook(\'pyls_completions\', doc_uri, position=position)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pyls\\python_ls.py", line 155, in _hook\n return hook_handlers(config=self.config, workspace=workspace, document=doc, **kwargs)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pluggy\\hooks.py", line 286, in __call__\n return self._hookexec(self, self.get_hookimpls(), kwargs)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pluggy\\manager.py", line 93, in _hookexec\n return self._inner_hookexec(hook, methods, kwargs)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pluggy\\manager.py", line 337, in traced_hookexec\n return outcome.get_result()\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pluggy\\callers.py", line 80, in get_result\n raise ex[1].with_traceback(ex[2])\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pluggy\\callers.py", line 52, in from_call\n result = func()\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pluggy\\manager.py", line 335, in <lambda>\n outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pluggy\\manager.py", line 87, in <lambda>\n firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pluggy\\callers.py", line 208, in _multicall\n return outcome.get_result()\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pluggy\\callers.py", line 80, in get_result\n raise ex[1].with_traceback(ex[2])\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pluggy\\callers.py", line 187, in _multicall\n res = hook_impl.function(*args)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pyls\\plugins\\jedi_completion.py", line 72, in pyls_completions\n return [_format_completion(d, include_params) for d in definitions] or None\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pyls\\plugins\\jedi_completion.py", line 72, in <listcomp>\n return [_format_completion(d, include_params) for d in definitions] or None\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pyls\\plugins\\jedi_completion.py", line 141, in _format_completion\n if (include_params and hasattr(d, \'params\') and d.params and\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\cache.py", line 143, in wrapper\n result = method(self, *args, **kwargs)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\api\\classes.py", line 345, in params\n for signature in value.get_signatures():\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\value\\instance.py", line 107, in get_signatures\n call_funcs = self.py__getattribute__(\'__call__\').py__get__(self, self.class_value)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\base_value.py", line 88, in py__getattribute__\n names = self.goto(name_or_str, name_context, analysis_errors)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\base_value.py", line 77, in goto\n names = finder.filter_name(filters, name_or_str)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\finder.py", line 36, in filter_name\n for filter in filters:\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\base_value.py", line 63, in _get_value_filters\n for f in self.get_filters(origin_scope=origin_scope):\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\value\\instance.py", line 163, in get_filters\n class_value = self.get_annotated_class_object()\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\value\\instance.py", line 343, in get_annotated_class_object\n return self._get_annotated_class_object() or self.class_value\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\cache.py", line 42, in wrapper\n rv = function(obj, *args, **kwargs)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\value\\instance.py", line 326, in _get_annotated_class_object\n if not signature.matches_signature(args) \\\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\signature.py", line 107, in matches_signature\n for executed_param_name in executed_param_names)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\signature.py", line 107, in <genexpr>\n for executed_param_name in executed_param_names)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\param.py", line 37, in matches_signature\n annotations = self.infer_annotation(execute_annotation=False)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\names.py", line 384, in infer_annotation\n ignore_stars=ignore_stars)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\cache.py", line 42, in wrapper\n rv = function(obj, *args, **kwargs)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\gradual\\annotation.py", line 113, in infer_param\n values = _infer_param(function_value, param)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\gradual\\annotation.py", line 184, in _infer_param\n return infer_annotation(context, annotation)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\gradual\\annotation.py", line 35, in infer_annotation\n value_set = context.infer_node(annotation)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\context.py", line 210, in infer_node\n return infer_node(self, node)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\syntax_tree.py", line 148, in infer_node\n return _infer_node_if_inferred(context, element)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\syntax_tree.py", line 161, in _infer_node_if_inferred\n return _infer_node_cached(context, element)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\cache.py", line 42, in wrapper\n rv = function(obj, *args, **kwargs)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\syntax_tree.py", line 166, in _infer_node_cached\n return _infer_node(context, element)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\debug.py", line 82, in wrapper\n return func(*args, **kwargs)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\syntax_tree.py", line 62, in wrapper\n return func(context, *args, **kwargs)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\syntax_tree.py", line 200, in _infer_node\n value_set = infer_trailer(context, value_set, trailer)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\syntax_tree.py", line 260, in infer_trailer\n ContextualizedNode(context, trailer)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\base_value.py", line 388, in get_item\n return ValueSet.from_sets(_getitem(c, *args, **kwargs) for c in self._set)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\common\\value.py", line 32, in from_sets\n for set_ in sets:\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\base_value.py", line 388, in <genexpr>\n return ValueSet.from_sets(_getitem(c, *args, **kwargs) for c in self._set)\n',
' File "C:\\Users\\uidn7351\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\jedi\\inference\\base_value.py", line 344, in _getitem\n result |= value.py__simple_getitem__(index)\n']}}
Could you provide the file where the completion is being requested before this error appears? (seeing the log seems like the file is CanoeConfigGenerator.py
)
Hi @dalthviz ,
I have shared the requested file as a zip file.
CanoeConfigGenerator.zip
Thanks @dasdebashish17 :)
Hello Guys, I have the same issue: Auto Completion does not work in Anaconda-Spyder 4.0.1
Also if I press Tab nothing shows up now but it worked fine for sometime with some issues though. Not sure what happened all of sudden.
As suggested in this thread, I ran this command: spyder --debug-info verbose --new-instance
, as it suggested me to run with new instance since there was an existing spyder instance running.
So, in the new instance, the auto completion and Tab thing is working fine but not the old one. What happened to the old spyder session where above functionalities are not working.
Any fixes for it?.
Hi @PraveenTumma could you try to update to Spyder 4.1.5 and check again? Thanks!
Hi @dalthviz, thanks for that fix. Yes, it worked. I was testing it multiple ways, like closing & opening all sessions, anaconda, exporting and importing variable data, etc., It is working as expected. Thanks!!
Awesome @PraveenTumma glad is working now for you :+1: . Just in case, @dasdebashish17 could you try to update Spyder too and check if this keeps being an issue? Thanks!
Most helpful comment
Hi @dalthviz, thanks for that fix. Yes, it worked. I was testing it multiple ways, like closing & opening all sessions, anaconda, exporting and importing variable data, etc., It is working as expected. Thanks!!