conda update spyder
(or pip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
The far left part of the editor displays yellow triangles that indicated pycodestyle warnings.
When I disable some of these warnings with e.g.
Tools -> Preferences -> Completion and linting -> Code Style [x] Enable code style linting -> Ignore the following warnings: "W291"
the yellow triangles disappear as desired.
The problem: When I restart Spyder the yellow warnings are still displays, even though the [x] Enable code style linting is still checked and the list of ignored warnings is not changed.
I expect to not see the yellow triangles that correspond to the e.g. "W291"
But they are still there.
N.A.
```
atomicwrites >=1.2.0 : 1.4.0 (OK)
chardet >=2.0.0 : 3.0.4 (OK)
cloudpickle >=0.5.0 : 1.6.0 (OK)
diff_match_patch >=20181111 : 20200713 (OK)
intervaltree : None (OK)
IPython >=4.0 : 7.18.1 (OK)
jedi =0.17.1 : 0.17.1 (OK)
keyring : None (OK)
nbconvert >=4.0 : 6.0.2 (OK)
numpydoc >=0.6.0 : 1.1.0 (OK)
parso =0.7.0 : 0.7.0 (OK)
pexpect >=4.4.0 : 4.8.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.7.2 (OK)
pygments >=2.0 : 2.7.0 (OK)
pylint >=1.0 : 2.6.0 (OK)
pyls >=0.34.0;<1.0.0 : 0.35.0 (OK)
qdarkstyle >=2.8 : 2.8.1 (OK)
qtawesome >=0.5.7 : 0.7.2 (OK)
qtconsole >=4.6.0 : 4.7.7 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
rtree >=0.8.3 : 0.9.4 (OK)
sphinx >=0.6.6 : 3.2.1 (OK)
spyder_kernels >=1.9.4;<1.10.0 : 1.9.4 (OK)
watchdog : None (OK)
xdg >=0.26 : 0.26 (OK)
zmq >=17 : 19.0.2 (OK)
cython >=0.21 : 0.29.21 (OK)
matplotlib >=2.0.0 : 3.1.2 (OK)
numpy >=1.7 : 1.15.4 (OK)
pandas >=0.13.1 : 1.1.2 (OK)
scipy >=0.17.0 : 1.4.1 (OK)
sympy >=0.7.3 : 1.6.2 (OK)
Hi @pawelusc maybe a fix for this was done in #13828. What happens if you restart the LSP using the option in the status bar?
Any new info that you could provide us is greatly appreciated :)
Hi @dalthviz,
thanks for this comment. I think that it is pointing in the right direction.
I was looking at the status bar and it turns out that the "LSP Python:" is in the "starting..." status basically forever.
When I restart LSP then, in turn, the "restarting..." status stays there forever.
Could you try to run Spyder with the flag --debug-info verbose
(something like spyder --debug-info verbose
) and check if any traceback raise in the output. Also, are you using a custom interpreter?
Alright, I run the --debug-info verbose and the output is huge, but nothing seems to be unusual in it
https://pastebin.com/W60NuVPN
When it comes to the interpreter, I believe that I use the standard one
Thanks @pawelusc for the info, checking it seems like an issue with numpy
? The traceback I found shows as message 'ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject'
:
2020-10-14 17:15:00,404 [DEBUG] [spyder.plugins.completion.languageserver.client] ->
python Response error: {'code': -32602, 'message': 'ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject',
'data': {'traceback': [
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pyls_jsonrpc/endpoint.py", line 113, in consume\n
self._handle_request(message[\'id\'], message[\'method\'], message.get(\'params\'))\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pyls_jsonrpc/endpoint.py", line 182, in _handle_request\n
handler_result = handler(params)\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pyls_jsonrpc/dispatchers.py", line 23, in handler\n
return method(**(params or {}))\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pyls/python_ls.py", line 213, in m_initialize\n
self._hook(\'pyls_initialize\')\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pyls/python_ls.py", line 156, in _hook\n
return hook_handlers(config=self.config, workspace=workspace, document=doc, **kwargs)\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__\n
return self._hookexec(self, self.get_hookimpls(), kwargs)\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec\n
return self._inner_hookexec(hook, methods, kwargs)\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 337, in traced_hookexec\n
return outcome.get_result()\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result\n
raise ex[1].with_traceback(ex[2])\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call\n
result = func()\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 335, in <lambda>\n
outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>\n
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall\n
return outcome.get_result()\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result\n
raise ex[1].with_traceback(ex[2])\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall\n
res = hook_impl.function(*args)\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pyls/plugins/preload_imports.py", line 31, in pyls_initialize\n
__import__(mod_name)\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pandas/__init__.py", line 30, in <module>\n
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib\n',
' File "/home/pawel/anaconda3/lib/python3.7/site-packages/pandas/_libs/__init__.py", line 13, in <module>\n
from pandas._libs.interval import Interval\n',
' File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval\n'
]}}
Could you see if updating numpy
helps @pawelusc ? Thanks!
@dalthviz, to avoid this issue, we should add a try/except around the method in the PyLS that preload modules. That seems to be placed here:
pyls/plugins/preload_imports.py
Could you do that?
Done @ccordoba12
Most helpful comment
Hi @pawelusc maybe a fix for this was done in #13828. What happens if you restart the LSP using the option in the status bar?
Any new info that you could provide us is greatly appreciated :)