spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.34k stars 1.62k forks source link

Code completion and linting stop working during the current session #11026

Closed Khris777 closed 4 years ago

Khris777 commented 4 years ago

After working for a while in Spyder at some point several functions just stop working:

Often there is no error message, sometimes there is one that tells me that code completion and linting will not work in the current session or have stopped working. It tells me to make sure that my firewall or antivirus allow Python processes to open ports on my system or to restart Spyder.

I'm working at a company behind a company firewall with an Antivirus Software.

My question is now:

  1. Why is it able to work for like 10 minutes before suddenly stopping? Apparently the local Python Language Server is working normally, so why does it suddenly stop?
  2. Can this be solved using the Proxy-Settings in the preferences?

EDIT 1: I played around with the advanced settings. In the end I enabled the usage of STDIO-Pipes and started Spyder with that option enabled. Performance was worse and the error also happened after a while, so I switched the option off and continued working. Apparently this restarted the language server and since then (about an hour ago) it has been running without fail. This makes it look more like the issue is not with my system's firewall or antivirus but some internal Spyder issue, maybe something that happens at startup?

EDIT 2: After about 4 hours the error happend again. I did what I did above, go into the settings, activate STDIO-Pipes, then deactivate it again, now the server is running again normally.

Versions

Dependencies

cloudpickle >=0.5.0          :  1.2.2 (OK)
pygments >=2.0               :  2.5.2 (OK)
qtconsole >=4.6.0            :  4.6.0 (OK)
nbconvert >=4.0              :  5.6.1 (OK)
sphinx >=0.6.6               :  2.2.2 (OK)
pylint >=0.25                :  2.4.4 (OK)
psutil >=0.3                 :  5.6.7 (OK)
qtawesome >=0.5.7            :  0.6.0 (OK)
qtpy >=1.5.0                 :  1.9.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
zmq >=17                     :  18.1.1 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
numpydoc >=0.6.0             :  0.9.1 (OK)
spyder_kernels >=1.8.1;<2.0.0:  1.8.1 (OK)
qdarkstyle >=2.7             :  2.7 (OK)
atomicwrites >=1.2.0         :  1.3.0 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
intervaltree                 :  None (OK)
watchdog                     :  None (OK)
keyring                      :  None (OK)
pexpect >=4.4.0              :  4.7.0 (OK)
pympler                      :  None (OK)
sympy >=0.7.3                :  1.4 (OK)
cython >=0.21                :  0.29.14 (OK)
IPython >=4.0                :  7.10.1 (OK)
matplotlib >=2.0.0           :  3.1.2 (OK)
pandas >=0.13.1              :  0.25.3 (OK)
numpy >=1.7                  :  1.17.3 (OK)
scipy >=0.17.0               :  1.3.1 (OK)
pyls >=0.31.2;<0.32.0        :  0.31.2 (OK)
rtree >=0.8.3                :  0.9.1 (OK)
Khris777 commented 4 years ago

I have been using Spyder normally today for about 3 hours now. The error didn't reappear and I didn't have to rely on that workaround I described above so far.

Sadly I have no clue what caused that error as it appeared rather randomly, I can't reproduce it. It's possible that switching from working with one file to another makes it more probable to occur, but that's speculation now.

ccordoba12 commented 4 years ago

I think this is caused by the server crashing at some point in the background. Therefore, I'll add a menu entry so that users can manually restart the server in case that happens.

@Khris777, that's equivalent to the workaround you mentioned and it'll be available in our next version.

martinrebane commented 4 years ago

I am using Spyder 4.0 (conda install) and all autocomplete and code navigation "crashes" all the time. Although I see no error, it just stops working. I found a nice way to reproduce it in my code, but not as a snippet. My code is a python file which includes many packages and has functions in it. This is tested inside one of the functions. But as Spyder crashes all the time, I guess this is not specific to my large project:

  1. write a line of code that has an error in it - red rectangle with an "x" is displayed
  2. do some typing and autocompletion (also suppress some with ESC) after the error - works
  3. do some typing and autocompletion before the line with an error - completion does not work any more
  4. Now I could even fix the parse error - the red rectangle does not disappear, code completion does not work etc. Just like a pure notepad :)

After closing Spyder and launching again all is fine. I suspect that the the issue might be related with parsing a larger project + fast user actions. I have noticed that I've also been hitting Esc to suppress some completion and typed myself fast. So perhaps it just crashes when not being able to handle typing speed combined with complex code and possible syntax errors. As I said, doing exactly the same thing in a vanilla python file does not crash Spyder. If there is a way to log what happens, I am happy to reproduce and log :)

Edit: my system is Python 3.6.9 on Ubuntu 18.04

ccordoba12 commented 4 years ago

@martinrebane, please post an animated gif of the situation you described above because I don't understand it very well.

martinrebane commented 4 years ago

@ccordoba12 Yes, I made a screencast. While recording I saw that it is even more simple than that. Now I got it crashed just be producing syntax error while typing. Here is the screen recording: https://youtu.be/GY_1hR5l8rc

  1. First I type on line 141, completion works
  2. When I start typing on line 143 you see that although syntax error mark appears, completion still works
  3. by the time in am on line 144 I have corrected the syntax error (so the red mark should disappear), but it stays there. Also, code completion has stopped working when I am typing inside the print statement. I am also hitting ctrl+space there, nothing happens.

Please let me know if I can help any further!

martinrebane commented 4 years ago

Just in case, here are my settings for code completion: Screenshot from 2019-12-16 20-17-39 Screenshot from 2019-12-16 20-18-01 Screenshot from 2019-12-16 20-18-52

Khris777 commented 4 years ago

While I had crashes last week, since monday I didn't have a single crash or problem anymore.

No idea why it's gone now.

Abalter85 commented 4 years ago

I have the same problem constantly. Mine does not go away. Only fix is to restart Spyder.

rhkarls commented 4 years ago

Same problem here as described in OP. I also have the same problem that @martinrebane describes, except I'm not working on any large/complex projects. Restarting Spyder fixes the issue for a short while. Sometimes its only minutes before the issue is back. Have tried resetting Spyder. I have not been able to see anything in logs/internal console - but I'd be happy to assist more if I can.

Spyder 4.0.0 Python 3.7.5 64-bit | Qt 5.12.5 | PyQt5 5.12.3 | Windows 10

OverLordGoldDragon commented 4 years ago

Just to add another - linter gets "stuck" thinking a variable is never used, even after it is, and even after its definition is commented entirely (which should yield a red marker): lint_demo.mp4 (note: using UTF-8 encoding)

Circumventable by cutting out a few lines above and below the offending one, and pasting back

matheger commented 4 years ago

Version 4.0.1, but still happens to me too - seemingly every single time I use Spyder. No idea how to produce it on purpose, other than just coding away for a while. Only fix I have found so far is to restart Spyder.

rhkarls commented 4 years ago

I saw issue #11501 and #11500 which I guess are the same as this issue or at least related.

Running Spyder with "--debug-info verbose" I get a different error (EOFError vs. ValueError) than #11501. Also with this level of debug enabled it appears the language server restarts. So code completion, linting, go to definition etc keeps working but continues to crash repeatedly when trying to code-complete. Same behavior with and without Kite enabled.

Running Spyder without debug it seems the language server just crashes and doesn't restart, as is described in the rest of this thread.

Edit: Spyder 4.0.1

```python-traceback File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\function.py", line 311, in get_executed_params_and_issues return self.var_args.get_executed_params_and_issues(self) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\instance.py", line 530, in get_executed_params_and_issues return self._wrapped_arguments.get_executed_params_and_issues(execution_context) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\instance.py", line 54, in get_executed_params_and_issues execution_context.tree_node File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 98, in search_params string_name=string_name, File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\utils.py", line 20, in wrapper return list(func(*args, **kwargs)) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 147, in _search_function_executions evaluator, random_context, compare_node, name, trailer): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 202, in _check_name_for_execution for value in evaluator.goto_definitions(context, name): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 280, in goto_definitions return helpers.evaluate_call_of_leaf(context, name) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\helpers.py", line 102, in evaluate_call_of_leaf values = context.eval_node(base) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 81, in eval_node return self.evaluator.eval_element(self, node) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 233, in eval_element return self._eval_element_if_evaluated(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 245, in _eval_element_if_evaluated return self._eval_element_cached(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 249, in _eval_element_cached return eval_node(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 50, in wrapper return func(context, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 74, in eval_node return eval_atom(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 203, in eval_atom search_global=True File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 72, in py__getattribute__ return f.find(filters, attribute_lookup=not search_global) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 67, in find types = self._names_to_types(names, attribute_lookup) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 190, in _names_to_types contexts = ContextSet.from_sets(name.infer() for name in names) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\common\context.py", line 32, in from_sets for set_ in sets: File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 190, in contexts = ContextSet.from_sets(name.infer() for name in names) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\names.py", line 226, in infer return self.get_param().infer() File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\names.py", line 229, in get_param params, _ = self.parent_context.get_executed_params_and_issues() File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\function.py", line 311, in get_executed_params_and_issues return self.var_args.get_executed_params_and_issues(self) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\instance.py", line 530, in get_executed_params_and_issues return self._wrapped_arguments.get_executed_params_and_issues(execution_context) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\instance.py", line 54, in get_executed_params_and_issues execution_context.tree_node File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 98, in search_params string_name=string_name, File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\utils.py", line 20, in wrapper return list(func(*args, **kwargs)) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 147, in _search_function_executions evaluator, random_context, compare_node, name, trailer): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 202, in _check_name_for_execution for value in evaluator.goto_definitions(context, name): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 280, in goto_definitions return helpers.evaluate_call_of_leaf(context, name) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\helpers.py", line 105, in evaluate_call_of_leaf values = eval_trailer(context, values, trailer) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 167, in eval_trailer name_or_str=node File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 406, in py__getattribute__ return ContextSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\common\context.py", line 32, in from_sets for set_ in sets: File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 406, in return ContextSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 72, in py__getattribute__ return f.find(filters, attribute_lookup=not search_global) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 67, in find types = self._names_to_types(names, attribute_lookup) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 190, in _names_to_types contexts = ContextSet.from_sets(name.infer() for name in names) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\common\context.py", line 32, in from_sets for set_ in sets: File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 190, in contexts = ContextSet.from_sets(name.infer() for name in names) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\names.py", line 143, in infer return tree_name_to_contexts(parent.evaluator, parent, self.tree_name) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 604, in tree_name_to_contexts types = _remove_statements(evaluator, context, node, tree_name) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 544, in _remove_statements return eval_expr_stmt(context, stmt, seek_name=name) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 50, in wrapper return func(context, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 287, in eval_expr_stmt return _eval_expr_stmt(context, stmt, seek_name) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 303, in _eval_expr_stmt context_set = context.eval_node(rhs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 81, in eval_node return self.evaluator.eval_element(self, node) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 233, in eval_element return self._eval_element_if_evaluated(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 245, in _eval_element_if_evaluated return self._eval_element_cached(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 249, in _eval_element_cached return eval_node(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 50, in wrapper return func(context, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 87, in eval_node context_set = context.eval_node(first_child) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 81, in eval_node return self.evaluator.eval_element(self, node) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 233, in eval_element return self._eval_element_if_evaluated(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 245, in _eval_element_if_evaluated return self._eval_element_cached(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 249, in _eval_element_cached return eval_node(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 50, in wrapper return func(context, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 74, in eval_node return eval_atom(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 203, in eval_atom search_global=True File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 72, in py__getattribute__ return f.find(filters, attribute_lookup=not search_global) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 67, in find types = self._names_to_types(names, attribute_lookup) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 190, in _names_to_types contexts = ContextSet.from_sets(name.infer() for name in names) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\common\context.py", line 32, in from_sets for set_ in sets: File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 190, in contexts = ContextSet.from_sets(name.infer() for name in names) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\names.py", line 226, in infer return self.get_param().infer() File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\names.py", line 229, in get_param params, _ = self.parent_context.get_executed_params_and_issues() File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\function.py", line 311, in get_executed_params_and_issues return self.var_args.get_executed_params_and_issues(self) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\instance.py", line 530, in get_executed_params_and_issues return self._wrapped_arguments.get_executed_params_and_issues(execution_context) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\instance.py", line 54, in get_executed_params_and_issues execution_context.tree_node File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 98, in search_params string_name=string_name, File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\utils.py", line 20, in wrapper return list(func(*args, **kwargs)) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 147, in _search_function_executions evaluator, random_context, compare_node, name, trailer): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 202, in _check_name_for_execution for value in evaluator.goto_definitions(context, name): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 280, in goto_definitions return helpers.evaluate_call_of_leaf(context, name) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\helpers.py", line 102, in evaluate_call_of_leaf values = context.eval_node(base) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 81, in eval_node return self.evaluator.eval_element(self, node) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 233, in eval_element return self._eval_element_if_evaluated(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 245, in _eval_element_if_evaluated return self._eval_element_cached(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 249, in _eval_element_cached return eval_node(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 50, in wrapper return func(context, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 74, in eval_node return eval_atom(context, element) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 203, in eval_atom search_global=True File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 72, in py__getattribute__ return f.find(filters, attribute_lookup=not search_global) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 67, in find types = self._names_to_types(names, attribute_lookup) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 190, in _names_to_types contexts = ContextSet.from_sets(name.infer() for name in names) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\common\context.py", line 32, in from_sets for set_ in sets: File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 190, in contexts = ContextSet.from_sets(name.infer() for name in names) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\names.py", line 226, in infer return self.get_param().infer() File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\names.py", line 229, in get_param params, _ = self.parent_context.get_executed_params_and_issues() File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\function.py", line 311, in get_executed_params_and_issues return self.var_args.get_executed_params_and_issues(self) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\instance.py", line 530, in get_executed_params_and_issues return self._wrapped_arguments.get_executed_params_and_issues(execution_context) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\instance.py", line 54, in get_executed_params_and_issues execution_context.tree_node File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 98, in search_params string_name=string_name, File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\utils.py", line 20, in wrapper return list(func(*args, **kwargs)) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 147, in _search_function_executions evaluator, random_context, compare_node, name, trailer): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\dynamic.py", line 202, in _check_name_for_execution for value in evaluator.goto_definitions(context, name): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 280, in goto_definitions return helpers.evaluate_call_of_leaf(context, name) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\helpers.py", line 105, in evaluate_call_of_leaf values = eval_trailer(context, values, trailer) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\syntax_tree.py", line 167, in eval_trailer name_or_str=node File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 406, in py__getattribute__ return ContextSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\common\context.py", line 32, in from_sets for set_ in sets: File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 406, in return ContextSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\base_context.py", line 72, in py__getattribute__ return f.find(filters, attribute_lookup=not search_global) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 56, in find names = self.filter_name(filters) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 152, in filter_name for filter in filters: File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\finder.py", line 122, in _get_context_filters for f in self._context.get_filters(False, self._position, origin_scope=origin_scope): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\module.py", line 102, in get_filters for star_filter in self.iter_star_filters(): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\module.py", line 140, in iter_star_filters for star_module in self.star_imports(): File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\module.py", line 162, in star_imports modules += module.star_imports() File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\context\module.py", line 157, in star_imports level=i.level File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\imports.py", line 296, in follow ) for parent_module_context in context_set File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\imports.py", line 296, in ) for parent_module_context in context_set File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 139, in import_module sys_path, prefer_stubs=prefer_stubs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\plugins\flask.py", line 24, in wrapper return callback(evaluator, import_names, module_context, *args, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\gradual\typeshed.py", line 110, in wrapper for p in parent_module_contexts File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\common\context.py", line 32, in from_sets for set_ in sets: File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\gradual\typeshed.py", line 110, in for p in parent_module_contexts File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\imports.py", line 436, in import_module is_package=is_pkg, File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\imports.py", line 457, in _load_python_module cache_path=settings.cache_directory File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 454, in parse return self.parse_and_get_code(*args, **kwargs)[0] File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\jedi\evaluate\__init__.py", line 451, in parse_and_get_code return grammar.parse(code=code, path=path, file_io=file_io, **kwargs), code File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\parso\grammar.py", line 78, in parse return self._parse(code=code, **kwargs) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\parso\grammar.py", line 105, in _parse module_node = load_module(self._hashed, file_io, cache_path=cache_path) File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\parso\cache.py", line 98, in load_module cache_path=cache_path File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\parso\cache.py", line 119, in _load_from_file_system module_cache_item = pickle.load(f) EOFError: Ran out of input ```
ccordoba12 commented 4 years ago

@rhkarls, please open the Anaconda prompt and run there

conda install parso=0.5.2

That should fix your problem.

rhkarls commented 4 years ago

@rhkarls, please open the Anaconda prompt and run there

conda install parso=0.5.2

That should fix your problem.

Cheers @ccordoba12 ! I was already running with parso 0.5.2. I tried upgrading to 0.6, and I got the same ValueError as reported in #11501. I downgraded again to 0.5.2 and it appears to work now - at least it doesn't crash straight away. A lot of other packages were also down/upgraded in the process by conda, including jedi, the language server and spyder+kernels.

goanpeca commented 4 years ago

Glad to hear it was solved!

OverLordGoldDragon commented 4 years ago

To note, I verified time and again that the more the total lines of code in all files opened, the sooner the linter's functionality degrades - worst-case, immediately

ccordoba12 commented 4 years ago

@OverLordGoldDragon, please don't start to comment in unrelated issues about your errors. Thanks!

OverLordGoldDragon commented 4 years ago

@ccordoba12 How's it unrelated? It's about linter not working after a while, just as the linked issue - I'm just adding information to a more active thread.

ccordoba12 commented 4 years ago

Sorry, I thought you were posting on a different issue.

skudekar commented 4 years ago

Hi @ccordoba12

I have a similar problem. I updated to spyder 4 and now the right-click "Go to definition" doesn't work anymore. I have windows 10 and Anaconda environment. I also tried putting my project directory in the PYTHONPATH manager and it still doesn't work. Is there a solution for this issue? My project files are big and not having this feature is making it impossible to work. Any help would be greatly appreciated. Do I need to uninstall and re-install spyder 4?

I tried the solution mentioned above but it seems that parso is already installed for me. See below. How do I check the version of parso installed? And can I simply conda uninstall parso and then again conda install parso=0.5.2? Thanks for your help!


Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.```
rhkarls commented 4 years ago

I tried the solution mentioned above but it seems that parso is already installed for me. See below. How do I check the version of parso installed? And can I simply conda uninstall parso and then again conda install parso=0.5.2?

conda list parso to see the version, or in a python console import parso followed by parso.__version__

Try the commands you suggested. What worked for me, for some unexplained reason, was to install parso 0.6.0 and then downgrade to 0.5.2.

skudekar commented 4 years ago

@rhkarls Thanks for the tips. I checked my parso version and indeed it was 0.5.2. So I tried to upgrade it first. So I ran conda update parso. And in the prompt it said that it would automatically downgrade spyder to 3.3.6. I accepted it and it works now. Today morning I had done conda update --all to fix some issues with pyTorch and torchvision installs. And didn;t realize that spyder got updated to 4.0.1.

Strangely enough, parso was upgraded to 0.6.1 and spyder to 3.3.6...automatically without even me forcing it so. But now with the downgrade of the spyder it all works. I'll keep it that way until perhaps the issues with spyder 4.0.1 are resolved. Thanks again for your timely response!! Much appreciated.

ricmarchao commented 4 years ago

just upgraded to spyder 4.1.1, windows 10 64b

it crashes every hour or so with this "completion and linting in the editor for python files will not work ", suspect it is due to the integration with kite

ccordoba12 commented 4 years ago

suspect it is due to the integration with kite

No, it's not.

BartBeemsterboer commented 4 years ago

I'm also experiencing this issue. It's quite annoying as I have to run specific parts of my code again each time I restart, to load the example data I need to continue coding.

I have tried all the above solutions and none of them have worked so far. It just keeps crashing whenever I use Spyder 4.

Is there any update/solution in sight?

ricmarchao commented 4 years ago

I am still getting spyder crashes every hour or so due to this problem, I did what @matheger suggested and started spyder in debug mode spyder --debug-info verbose: now I get this on the issue reporter

File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\star_args.py", line 188, in process_params )), star_count=2): File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\utils.py", line 20, in wrapper return list(func(*args, **kwargs)) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\star_args.py", line 187, in process_params signature.get_param_names(resolve_stars=False) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\star_args.py", line 79, in _remove_given_params for key, _ in arguments.unpack(): File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\arguments.py", line 212, in unpack arrays = self.context.infer_node(el) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 210, in infer_node return infer_node(self, node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 148, in infer_node return _infer_node_if_inferred(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 161, in _infer_node_if_inferred return _infer_node_cached(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 166, in _infer_node_cached return _infer_node(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 62, in wrapper return func(context, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 176, in _infer_node return infer_atom(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 301, in infer_atom return context.py__getattribute__(atom, position=position) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 75, in py__getattribute__ values = ValueSet.from_sets(name.infer() for name in names) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\common\value.py", line 32, in from_sets for set_ in sets: File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 75, in values = ValueSet.from_sets(name.infer() for name in names) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\names.py", line 237, in infer self.tree_name File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\plugins\__init__.py", line 21, in wrapper return built_functions[name](*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\plugins\stdlib.py", line 827, in wrapper return func(inference_state, context, tree_name) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 726, in tree_name_to_values types = _remove_statements(context, node, tree_name) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 661, in _remove_statements return infer_expr_stmt(context, stmt, seek_name=name) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 62, in wrapper return func(context, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 370, in infer_expr_stmt return _infer_expr_stmt(context, stmt, seek_name) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 402, in _infer_expr_stmt value_set = context.infer_node(rhs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 210, in infer_node return infer_node(self, node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 148, in infer_node return _infer_node_if_inferred(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 161, in _infer_node_if_inferred return _infer_node_cached(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 166, in _infer_node_cached return _infer_node(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 62, in wrapper return func(context, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 189, in _infer_node value_set = context.infer_node(first_child) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 210, in infer_node return infer_node(self, node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 148, in infer_node return _infer_node_if_inferred(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 161, in _infer_node_if_inferred return _infer_node_cached(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 166, in _infer_node_cached return _infer_node(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 62, in wrapper return func(context, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 176, in _infer_node return infer_atom(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 301, in infer_atom return context.py__getattribute__(atom, position=position) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 75, in py__getattribute__ values = ValueSet.from_sets(name.infer() for name in names) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\common\value.py", line 32, in from_sets for set_ in sets: File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 75, in values = ValueSet.from_sets(name.infer() for name in names) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\names.py", line 237, in infer self.tree_name File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\plugins\__init__.py", line 21, in wrapper return built_functions[name](*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\plugins\stdlib.py", line 827, in wrapper return func(inference_state, context, tree_name) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 719, in tree_name_to_values cn.infer(), File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 330, in infer return self.context.infer_node(self.node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 210, in infer_node return infer_node(self, node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 148, in infer_node return _infer_node_if_inferred(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 161, in _infer_node_if_inferred return _infer_node_cached(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 166, in _infer_node_cached return _infer_node(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 62, in wrapper return func(context, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 200, in _infer_node value_set = infer_trailer(context, value_set, trailer) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 267, in infer_trailer name_or_str=node File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 385, in py__getattribute__ return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\common\value.py", line 32, in from_sets for set_ in sets: File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 385, in return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 88, in py__getattribute__ names = self.goto(name_or_str, name_context, analysis_errors) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 77, in goto names = finder.filter_name(filters, name_or_str) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\finder.py", line 36, in filter_name for filter in filters: File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 63, in _get_value_filters for f in self.get_filters(origin_scope=origin_scope): File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\filters.py", line 339, in get_filters yield SpecialMethodFilter(self, self.overwritten_methods, self._wrapped_value) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\utils.py", line 75, in wrapper return func(*args, **kwds) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\cache.py", line 143, in wrapper result = method(self, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 295, in _wrapped_value return self._get_wrapped_value() File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\iterable.py", line 202, in _get_wrapped_value TupleGenericManager(self._get_generics()) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\iterable.py", line 194, in _get_generics return (self.merge_types_of_iterate().py__class__(),) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 58, in merge_types_of_iterate for lazy_value in self.iterate(contextualized_node, is_async) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\common\value.py", line 32, in from_sets for set_ in sets: File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 57, in lazy_value.infer() File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\iterable.py", line 261, in py__iter__ for keys, values in self._iterate(): File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\utils.py", line 20, in wrapper return list(func(*args, **kwargs)) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\iterable.py", line 170, in _iterate for result in self._nested(comp_fors): File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\iterable.py", line 142, in _nested input_types = parent_context.infer_node(input_node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 210, in infer_node return infer_node(self, node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 148, in infer_node return _infer_node_if_inferred(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 161, in _infer_node_if_inferred return _infer_node_cached(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 166, in _infer_node_cached return _infer_node(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 62, in wrapper return func(context, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 176, in _infer_node return infer_atom(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 301, in infer_atom return context.py__getattribute__(atom, position=position) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 43, in py__getattribute__ names = self.goto(name_or_str, position) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 32, in goto names = finder.filter_name(filters, name_or_str) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\finder.py", line 37, in filter_name names = filter.get(string_name) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\filters.py", line 83, in get **filter_kwargs File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\filters.py", line 122, in _filter return list(self._check_flows(names)) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\filters.py", line 137, in _check_flows origin_scope=self._origin_scope File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\flow_analysis.py", line 78, in reachability_check return _break_check(context, value_scope, first_flow_scope, node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\flow_analysis.py", line 86, in _break_check reachable = _check_if(context, check_node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\flow_analysis.py", line 113, in _check_if types = context.infer_node(node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 210, in infer_node return infer_node(self, node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 148, in infer_node return _infer_node_if_inferred(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 161, in _infer_node_if_inferred return _infer_node_cached(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 166, in _infer_node_cached return _infer_node(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 62, in wrapper return func(context, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 200, in _infer_node value_set = infer_trailer(context, value_set, trailer) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 267, in infer_trailer name_or_str=node File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 385, in py__getattribute__ return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\common\value.py", line 32, in from_sets for set_ in sets: File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 385, in return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 88, in py__getattribute__ names = self.goto(name_or_str, name_context, analysis_errors) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 77, in goto names = finder.filter_name(filters, name_or_str) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\finder.py", line 36, in filter_name for filter in filters: File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 63, in _get_value_filters for f in self.get_filters(origin_scope=origin_scope): File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\filters.py", line 339, in get_filters yield SpecialMethodFilter(self, self.overwritten_methods, self._wrapped_value) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\utils.py", line 78, in wrapper reraise(UncaughtAttributeError(exc_info[1]), exc_info[2]) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\_compatibility.py", line 298, in reraise raise exception.with_traceback(traceback) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\utils.py", line 75, in wrapper return func(*args, **kwds) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\cache.py", line 143, in wrapper result = method(self, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\base_value.py", line 295, in _wrapped_value return self._get_wrapped_value() File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\iterable.py", line 202, in _get_wrapped_value TupleGenericManager(self._get_generics()) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\iterable.py", line 183, in _get_generics return tuple(c_set.py__class__() for c_set in self.get_mapping_item_values()) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\iterable.py", line 560, in get_mapping_item_values return self._dict_keys(), self._dict_values() File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\iterable.py", line 554, in _dict_values return ValueSet.from_sets(lazy_value.infer() for lazy_value in self._dct.values()) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\common\value.py", line 32, in from_sets for set_ in sets: File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\iterable.py", line 554, in return ValueSet.from_sets(lazy_value.infer() for lazy_value in self._dct.values()) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\lazy_value.py", line 46, in infer return self.context.infer_node(self.data) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 210, in infer_node return infer_node(self, node) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 148, in infer_node return _infer_node_if_inferred(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 161, in _infer_node_if_inferred return _infer_node_cached(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 166, in _infer_node_cached return _infer_node(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 62, in wrapper return func(context, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 176, in _infer_node return infer_atom(context, element) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\syntax_tree.py", line 301, in infer_atom return context.py__getattribute__(atom, position=position) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 75, in py__getattribute__ values = ValueSet.from_sets(name.infer() for name in names) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\common\value.py", line 32, in from_sets for set_ in sets: File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\context.py", line 75, in values = ValueSet.from_sets(name.infer() for name in names) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\names.py", line 446, in infer values = dynamic_param_lookup(self.function_value, param.position_index) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\debug.py", line 82, in wrapper return func(*args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\dynamic_params.py", line 47, in wrapper return func(function_value, param_index) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\dynamic_params.py", line 92, in dynamic_param_lookup arguments_list = _search_function_arguments(module_context, funcdef, string_name) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\cache.py", line 42, in wrapper rv = function(obj, *args, **kwargs) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\utils.py", line 20, in wrapper return list(func(*args, **kwargs)) File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\dynamic_params.py", line 132, in _search_function_arguments inference_state, random_context, compare_node, name, trailer): File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\dynamic_params.py", line 198, in _check_name_for_execution param_names = value.parent_context.get_param_names() File "D:\Anaconda3\envs\py37\lib\site-packages\jedi\inference\value\instance.py", line 65, in get_param_names self._function_value, jedi.inference.utils.UncaughtAttributeError: 'AnonymousMethodExecutionContext' object has no attribute '_function_value'
ccordoba12 commented 4 years ago

I am still getting spyder crashes every hour or so due to this problem

Is that a hard crash (i.e. Spyder closes immediately)? Or does Spyder show the "Completion and linting stop working" message and open the issue reporter?

BartBeemsterboer commented 4 years ago

Try running Spyder with --debug-info verbose. It will nag you with crash report windows instead of just rolling over and dying.

If you also add --debug-output file, it will create a log file somewhere in your personal folder. Might be useful for tracking this further.

Thank you. But how exactly do I do that?

matheger commented 4 years ago

Thank you. But how exactly do I do that?

I've edited my post above with a howto. Hope it helps!

ricmarchao commented 4 years ago

@ccordoba12

Is that a hard crash (i.e. Spyder closes immediately)? Or does Spyder show the "Completion and linting stop working" message and open the issue reporter?

if I am not in debug mode, I get the error and every time I try to write something the message pops up again , so I have to shutdown spyder and restart

if I am on debug mode the error report pops up and I can close it and continue

JoElfner commented 4 years ago

I also have this issue since upgrading to Spyder 4.1.1 Unluckily I cannot reproduce the error by doing something specific. It just happens after around 10 to 20 minutes of coding.

ghost commented 4 years ago

I hope this gets resolved. This is getting a little intolerable that I have to restart spyder after hours of coding.

goanpeca commented 4 years ago

We are working on this to improve the current UI and also add the possibility of restarting the language server manually. The new release should be available next week.

Khris777 commented 4 years ago

Adding to all of this, apart from often simply stopping to work without notice, sometimes it stops with that error message, and it will then spam the error message on every single keystroke.

Just saving my file provokes the error message to appear twice, so it becomes impossible to work and only a restart helps.

ChemicalSailor commented 4 years ago

We are working on this to improve the current UI and also add the possibility of restarting the language server manually. The new release should be available next week.

Thanks for your efforts in sorting this out. The new linting and completion mechanisms will definitely be a step up when working properly. In the meantime is it possible to implement an option to use the old linter in Spyder 4 so that we can benefit from the other great features? I've found that linting fails after just a couple of minutes with just one relatively small file open. It sounds like the fixes you're working on won't solve the root problem and manually restarting the language server isn't going to be viable if it falls over every couple of minutes. I think if people can use the old linter it gives you more time to figure out all the issues.

JoElfner commented 4 years ago

Also thanks from my side! Is there any quick fix for this? When coding heavily, this error appears more frequently than every 20 minutes. Having to clear the cache/variables etc. by restarting every few minutes totally kills my efficiency at work. Is there any quick fix or a workaround by completely killing the linting? Otherwise I'll have to switch to PyCharm, which I'd like to avoid.

matheger commented 4 years ago

I just realized that my solution to start Spyder in debug mode fixed a different problem - that of random Spyder crashes - but not the one in the OP. I mistook one for the other because I never had the exact error message about linting/code completion and didn't read the description carefully enough. Today is the first time I ever saw it in person. I deleted my post above to not lead future readers astray.

goanpeca commented 4 years ago

The fix has been made and a new version coming next week. Thanks for the help debugging and your patience.

rhkarls commented 4 years ago

The fix has been made and a new version coming next week. Thanks for the help debugging and your patience.

Thanks a lot @goanpeca and @ccordoba12 !

ccordoba12 commented 4 years ago

To those interested in our solution, we've done the following to improve this annoying situation:

matheger commented 4 years ago

While those features may help, they seem to be only remedial to recover from the aftermath of the error. Do you have any idea yet why it happens in the first place?

ccordoba12 commented 4 years ago

While those features may help, they seem to be only remedial to recover from the aftermath of the error

Hopefully things will go unnoticed from now on when the server stops working for most users, because it'll be restarted by Spyder automatically.

Do you have any idea yet why it happens in the first place?

We're still investigating the issue.

matheger commented 4 years ago

Fair enough. Fingers crossed! Looking forward to the next update.

ricmarchao commented 4 years ago

regarding the fix for next week that automatically restarts the server: what happens to the workspace ? the variables that are in memory? will these values be lost?

Hope not, since that would mean restarting work every hour or so

MaartenBransen commented 4 years ago

regarding the fix for next week that automatically restarts the server: what happens to the workspace ? the variables that are in memory? will these values be lost?

Hope not, since that would mean restarting work every hour or so

I suspect not. There is a workaround (going into preferences, completion and linting, advanced, select 'use stdio pipes', apply, deselect use stdio pipes' again and apply) which effectively does the same (restarting the server), which has always worked for me so far and does not do anything to the workspace, variables, etc.

ccordoba12 commented 4 years ago

what happens to the workspace ? the variables that are in memory? will these values be lost?

@ricmarchao, the restart is done in place, so you don't need to restart Spyder and lose your work.

LuisAzabache commented 4 years ago

To those interested in our solution, we've done the following to improve this annoying situation:

  • Add an option to never show the intrusive message again. Selección_004
  • Add a mechanism that tries to detect if the server went down and tries to automatically restart it.
  • Add a new entry to the status bar that shows the status of the server (starting, ready, restarting or down) and a menu entry that allows to restart it manually: imagen

How to get that option?

ccordoba12 commented 4 years ago

It'll be available in our 4.1.2 version, to be released in a couple of days.

LuisAzabache commented 4 years ago

Glad to know that and thanks for your effort.

pbower commented 4 years ago

While those features may help, they seem to be only remedial to recover from the aftermath of the error

Hopefully things will go unnoticed from now on when the server stops working for most users, because it'll be restarted by Spyder automatically.

Do you have any idea yet why it happens in the first place?

We're still investigating the issue.

Thanks for doing this. As a user though I do feel Spyder is getting quite slow and slightly delayed to work with, even with just typing code for example. Responsiveness in the program is really important and these kind of constant checks and workarounds can impact reliability of the program. Though I love Spyder, I am seriously close to changing IDE's as a result of the constant interruptions with this error, crashes and instability. Hope a true fix rather than workaround can be found? Even getting a dialog every 20 minutes is extremely annoying when you are trying to focus. At least the variable memory will not be erased due to program crash. Happy to help with anything. Cheers Peter