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.

Import sklearn dumps core

See original GitHub issue

I built sklearn and trying to import with Python3.7 getting core dump

Python 3.7.5 (default, Nov  9 2019, 17:49:52) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform; print(platform.platform())
Linux-4.19.46-4.19.1-amd64-9cf031ffa09555f2-x86_64-with-debian-stretch-sid
>>> import sys; print("Python", sys.version)
Python 3.7.5 (default, Nov  9 2019, 17:49:52) 
[GCC 5.4.0 20160609]
>>> import numpy; print("NumPy", numpy.__version__)
NumPy 1.17.1
>>> import scipy; print("SciPy", scipy.__version__)
SciPy 1.3.1
>>> import sklearn; print("Scikit-Learn", sklearn.__version__)
Segmentation fault (core dumped)

Stack Trace

====== #0 0x00007fffed400d4e in PyTuple_New (size=<optimized out>) at Objects/tupleobject.c:133 #1 0x00007fffed40824e in PyType_Ready (type=type@entry=0x7fffed80fe80 <PyBaseObject_Type>) at Objects/typeobject.c:5196 #2 0x00007fffed4081d6 in PyType_Ready (type=0x7fffed808b80 <PyModuleDef_Type>) at Objects/typeobject.c:5178 #3 0x00007fffed3f2250 in PyModuleDef_Init (def=0x7fffed7ef600 <__pyx_moduledef>) at Objects/moduleobject.c:46 #4 0x00000000004d7345 in _PyImport_LoadDynamicModuleWithSpec (spec=spec@entry=0x7fffed8b28d0, fp=fp@entry=0x0) at ./Python/importdl.c:159 #5 0x00000000004d5195 in _imp_create_dynamic_impl (module=<optimized out>, file=<optimized out>, spec=0x7fffed8b28d0) at Python/import.c:2170 #6 _imp_create_dynamic (module=<optimized out>, args=<optimized out>, nargs=<optimized out>) at Python/clinic/import.c.h:289 #7 0x000000000043a544 in _PyMethodDef_RawFastCallDict (method=0x844460 <imp_methods+320>, self=0x7ffff7f6bcb0, args=<optimized out>, nargs=1, kwargs=<optimized out>) at Objects/call.c:530 #8 0x000000000043a5f5 in _PyCFunction_FastCallDict (func=0x7ffff7f847d0, args=<optimized out>, nargs=<optimized out>, kwargs=<optimized out>) at Objects/call.c:586 #9 0x0000000000429e26 in do_call_core (kwdict=0x7fffed8b0aa0, callargs=0x7fffed8b22d0, func=0x7ffff7f847d0) at Python/ceval.c:4641 #10 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3191 #11 0x00000000004be574 in _PyEval_EvalCodeWithName (_co=0x7ffff7f73150, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=2, kwnames=0x0, kwargs=kwargs@entry=0x7ffff650fb00, kwcount=kwcount@entry=0, kwstep=kwstep@entry=1, defs=0x0, defcount=0, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, name=name@entry=0x7ffff7f71300, qualname=qualname@entry=0x7ffff7f71300) at Python/ceval.c:3930 #12 0x000000000043987d in _PyFunction_FastCallKeywords (func=<optimized out>, stack=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Objects/call.c:433 #13 0x0000000000429b3c in call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>) at Python/ceval.c:4616 #14 _PyEval_EvalFrameDefault (f=<optimized … … …

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
monikasonicommented, Nov 15, 2019

The problem is custom way my packages were being built. We use company specific build framework and it introduced linkage with -lpython3.7m from some configuration file. When linking the dynamic library is removed import works fine. Closing to the issue now.

Thanks for your time @glemaitre.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does scikit-learn cause core dumped? - Stack Overflow
I try to run a simple linear fit in scikit-learn: from sklearn import ...
Read more >
Out-of-core classification of text documents - Scikit-learn
This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into...
Read more >
How to use the sklearn.externals.joblib.dump function in sklearn
Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately. Enable here. github alfredfrancis /...
Read more >
Core ML Supports Scikit-learn? | Apple Developer Forums
Pickle is a Python protocol that is used to seralize arbitary Python code and classes. You should be able to write code to...
Read more >
Train scikit-learn models at scale with Azure Machine Learning
Whether you're training a machine learning scikit-learn model from the ... Handle to the workspace from azure.ai.ml import MLClient ...
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