File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 29
29
import sys
30
30
import os
31
31
32
- from .env import is_remote , has_display
32
+ from .env import is_remote , has_display , is_numpy_openblas
33
33
34
34
35
35
VERSION = '0.8.3'
44
44
# mutlithreaded app.
45
45
#
46
46
if platform .system () == 'Darwin' :
47
+ if 'numpy' in sys .modules and is_numpy_openblas ():
48
+ sys .stderr .write (
49
+ 'WARNING: numpy was imported before jupylet. ' +
50
+ 'On Mac OS X you should import jupylet first to let it work around ' +
51
+ 'a bug in the algebra libraries used by numpy, that may cause the ' +
52
+ 'program to exit.' + '\n '
53
+ )
54
+
47
55
os .environ ['OPENBLAS_NUM_THREADS' ] = '1'
48
56
49
57
Original file line number Diff line number Diff line change @@ -103,6 +103,15 @@ def is_binder_env():
103
103
return 'BINDER_REQUEST' in os .environ
104
104
105
105
106
+ def is_numpy_openblas ():
107
+ import numpy
108
+ ll = numpy .__config__ .get_info ('blas_opt_info' )['libraries' ]
109
+ for l in ll :
110
+ if 'openblas' in l :
111
+ return True
112
+ return False
113
+
114
+
106
115
def is_osx ():
107
116
return platform .system ().lower () == 'darwin'
108
117
You can’t perform that action at this time.
0 commit comments