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.

Ctrl C crashes python during sleep if sklear is imported

See original GitHub issue

Hello I’m sorry but I have to reopen this:

Here is a simple test, I launch a time.sleep and while it’s sleeping i press Ctrl C. The issue (as you can see below) happens on sklearn, not other packages (PS I can reproduce it everytime)

image

I also have found this issue in scipy.stats BTW. I also found this issue on it here, but I cannot apply the solution to this case because I cannot load manually the libifcoremd.dll (I don’t find it in my environment packages, only the PYD)

I have tried to reset the signal handler to the default value with signal.signal(signal.SIGINT, signal.SIG_DFL) without any success.

problem may be related to fortran https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/518251

If someone could help me to adapt the solution mentioned to this case.

Thank you in advance

PS this was seen in #9431 before but closed

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
lestevecommented, Sep 19, 2017

I can reproduce on a Windows VM. Glad you found a solution to your problem.

This is not directly related to scikit-learn (you can easily find examples only using scipy) and seems to be linked with the Intel Fortran compiler installing a Ctrl-C handler on Windows. The best link I could find is https://github.com/ContinuumIO/anaconda-issues/issues/905#issuecomment-232498034 (more references in this issue).

There was a PR on scipy that was never merged: https://github.com/scipy/scipy/pull/3880. @acourdavault I think you would be more than welcome to open a PR on scipy if you have the spare bandwidth.

1reaction
rthcommented, Sep 19, 2017

@acourdavault Thanks for reporting this. It would have probably been better to continue in the parent issue just FYI. Also, please make sure you had a look at the bug submission guidelines (particularly regarding using code formatting instead of screenshots and providing the version numbers with the included code snippet). Could you please post the output of the “versions” code snippet? How did you install scikit-learn?

I tried to reproduce this issue with this script using Python 3.6 and scikit-learn installed with conda on Appveyor. So far unsuccessfully (i.e. I don’t get this error), but maybe someone on Windows would be more lucky…

Could you please confirm that the above-linked script raises an exception on your system? Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ctrl-C crashes Python after importing scipy.stats - Stack Overflow
In the case of the time module, its console control handler sets a Windows event, hInterruptEvent . For the main thread, time.sleep waits...
Read more >
Signal handling: Catch Ctrl-C in Python - Code Maven
Catching the Ctrl-C signal in Python and changing the default behavior of the code.
Read more >
PyInstaller Documentation - Read the Docs
Some Python scripts import modules in ways that PyInstaller cannot ... The _MEIxxxxxx folder is not removed if the program crashes or is...
Read more >
Unicode error for python echo server when "Ctrl+C" pressed
I have implemented some commands like time,exit and network (i.e. if you type 'time' command on telnet client, the server responds with system...
Read more >
How to Grid Search Hyperparameters for Deep Learning ...
Need help with Deep Learning in Python? ... from sklearn.model_selection import GridSearchCV ... max v April 21, 2019 at 12:52 am #.
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