Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import sklearn dumps core #15580

Closed
monikasoni opened this issue Nov 9, 2019 · 5 comments
Closed

Import sklearn dumps core #15580

monikasoni opened this issue Nov 9, 2019 · 5 comments

Comments

@monikasoni
Copy link

monikasoni commented Nov 9, 2019

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=) 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=, file=, spec=0x7fffed8b28d0)
at Python/import.c:2170
#6 _imp_create_dynamic (module=, args=, nargs=) at Python/clinic/import.c.h:289
#7 0x000000000043a544 in _PyMethodDef_RawFastCallDict (method=0x844460 <imp_methods+320>, self=0x7ffff7f6bcb0,
args=, nargs=1, kwargs=) at Objects/call.c:530
#8 0x000000000043a5f5 in _PyCFunction_FastCallDict (func=0x7ffff7f847d0, args=, nargs=,
kwargs=) 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=, throwflag=) at Python/ceval.c:3191
#11 0x00000000004be574 in _PyEval_EvalCodeWithName (_co=0x7ffff7f73150, globals=, locals=locals@entry=0x0,
args=, 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=, stack=, nargs=,
kwnames=) at Objects/call.c:433
#13 0x0000000000429b3c in call_function (kwnames=0x0, oparg=, pp_stack=) at Python/ceval.c:4616
#14 _PyEval_EvalFrameDefault (f=<optimized
...
...
...

@glemaitre
Copy link
Member

Could you describe the way that you try to install scikit-learn: from source, via pip, via conda?
In case you installed it from source, could you also give the version of Cython.

@monikasoni
Copy link
Author

I am trying to build from source, Using Cython-0.28.5
Also set env variable SKLEARN_NO_OPENMP to 0.
'export SKLEARN_NO_OPENMP=0'

@glemaitre
Copy link
Member

You will have support for OpenMP with the version of gcc that you are using.
When compiling with Cython, do you have any issues? You can post the output of the command make clean && make in from the root folder.

@monikasoni
Copy link
Author

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.

@glemaitre
Copy link
Member

glemaitre commented Nov 15, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants