question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running user-defined functions on console return only when stopped manually

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Hello, When calling various user-defined functions or creating instances of user-defined classes from console, it will run indefinitely until I press Stop debugging (Ctrl+Shift+F12) twice, although I wasn’t even in debugging mode, just running commands from the console. Furthermore, for some reason the command won’t start to run until I press Shift+Enter (pressing Enter will do nothing). When printing the running time at various locations in the function, the times are printed only after pressing Stop debugging twice. Also, the times correspond to regular running time, i.e. very short. So I figure that the function runs and then gets stuck before returning for some reason. This does not happen for every user defined function or class, and I could not identify the pattern. However, when it does happen for some function, it is quite consistent. It always happens only at first call to the function with some set of inputs. If I run the same again, it will run normally. But if I change the inputs to the function, it is stuck again. When running the cell/file, this problem does not occur. It also does not occur when running ipython from terminal. It does occur when running it from a jupyter qtconsole. Please tell me If I should delete this and post it on jupyter qtconsole issues instead. I know this might seem like a strange and maybe ill-described problem, but this problem is bugging me for a very long time, through different versions of anaconda and spyder and on different computers. I appreciate any help.

What steps reproduce the problem?

  1. Define some function
  2. Run it from console

What is the expected output? What do you see instead?

Expected: Normal execution of the command after pressing Enter. Instead the command won’t start to run upon Enter and when pressing Shift+Enter it will run indefinitely until pressing Stop debugging twice which will make the function return. Sometimes Ctrl+C also makes the function return.

Versions

  • Spyder version: 5.1.5 None
  • Python version: 3.8.12 64-bit
  • Qt version: 5.9.7
  • PyQt5 version: 5.9.2
  • Operating System: Linux 5.4.0-90-generic

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.29.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.17.2 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.1.0 (OK)
nbconvert >=4.0               :  6.1.0 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
parso >=0.7.0;<0.9.0          :  0.7.0 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.10.0 (OK)
pylint >=2.5.0;<2.10.0        :  2.9.6 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.2.2;<1.3.0          :  1.2.4 (OK)
pylsp_black >=1.0.0           :  None (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=1.0.2             :  1.0.2 (OK)
qtconsole >=5.1.0             :  5.1.1 (OK)
qtpy >=1.5.0                  :  1.10.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  58.0.4 (OK)
sphinx >=0.6.6                :  4.2.0 (OK)
spyder_kernels >=2.1.1;<2.2.0 :  2.1.3 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.3 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  22.2.1 (OK)

# Optional:
cython >=0.21                 :  0.29.24 (OK)
matplotlib >=2.0.0            :  3.4.3 (OK)
numpy >=1.7                   :  1.20.3 (OK)
pandas >=1.1.1                :  1.3.4 (OK)
scipy >=0.17.0                :  1.7.1 (OK)
sympy >=0.7.3                 :  1.9 (OK)```

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yuvalwascommented, Dec 6, 2021

Thank you anyway, really appreciate your work. Hopefully you’ll also support Julia someday.

0reactions
ccordoba12commented, Dec 6, 2021

Closing because I don’t think we can do something else about this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - How to stop a function - Stack Overflow
My problem is that if a certain condition becomes true (in the function check_winner ) and function end() executes it will go back...
Read more >
Manage functions | Cloud Functions for Firebase - Google
Deploy functions. To deploy functions, run this Firebase CLI command: firebase deploy --only ...
Read more >
The 10 Most Common JavaScript Issues Developers Face
If you need help figuring out why your JavaScript isn't working, consult this list of the 10 most common JavaScript issues from a...
Read more >
Guide for running C# Azure Functions in an isolated worker ...
Learn how to use a .NET isolated worker process to run your C# functions in Azure, which supports non-LTS versions of .NET and...
Read more >
User-Defined Functions (UDFs) | 6.3.x
Impala can run Java-based user-defined functions (UDFs), originally written for Hive, with no changes, subject to the following conditions: The ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found