17
17
VCOMP140_SRC_PATH = "C:\\ Windows\\ System32\\ vcomp140.dll"
18
18
VCRUNTIME140_SRC_PATH = "C:\\ Windows\\ System32\\ vcruntime140.dll"
19
19
VCRUNTIME140_1_SRC_PATH = "C:\\ Windows\\ System32\\ vcruntime140_1.dll"
20
+ MSVCP140_SRC_PATH = "C:\\ Windows\\ System32\\ msvcp140.dll"
20
21
21
22
22
23
def make_distributor_init_32_bits (
@@ -65,12 +66,13 @@ def make_distributor_init_64_bits(
65
66
vcomp140_dll_filename ,
66
67
vcruntime140_dll_filename ,
67
68
vcruntime140_1_dll_filename ,
69
+ msvcp140_dll_filename ,
68
70
):
69
71
"""Create a _distributor_init.py file for 64-bit architectures.
70
72
71
73
This file is imported first when importing the sklearn package
72
- so as to pre-load the vendored vcomp140.dll, vcruntime140.dll
73
- and vcruntime140_1 .dll.
74
+ so as to pre-load the vendored vcomp140.dll, vcruntime140.dll,
75
+ vcruntime140_1.dll and msvcp140 .dll.
74
76
"""
75
77
with open (distributor_init , "wt" ) as f :
76
78
f .write (
@@ -97,13 +99,16 @@ def make_distributor_init_64_bits(
97
99
vcomp140_dll_filename = op.join(libs_path, "{0}")
98
100
vcruntime140_dll_filename = op.join(libs_path, "{1}")
99
101
vcruntime140_1_dll_filename = op.join(libs_path, "{2}")
102
+ msvcp140_dll_filename = op.join(libs_path, "{3}")
100
103
WinDLL(op.abspath(vcomp140_dll_filename))
101
104
WinDLL(op.abspath(vcruntime140_dll_filename))
102
105
WinDLL(op.abspath(vcruntime140_1_dll_filename))
106
+ WinDLL(op.abspath(msvcp140_dll_filename))
103
107
""" .format (
104
108
vcomp140_dll_filename ,
105
109
vcruntime140_dll_filename ,
106
110
vcruntime140_1_dll_filename ,
111
+ msvcp140_dll_filename ,
107
112
)
108
113
)
109
114
)
@@ -120,12 +125,16 @@ def main(wheel_dirname, bitness):
120
125
if not op .exists (VCRUNTIME140_1_SRC_PATH ) and bitness == "64" :
121
126
raise ValueError (f"Could not find { VCRUNTIME140_1_SRC_PATH } ." )
122
127
128
+ if not op .exists (MSVCP140_SRC_PATH ) and bitness == "64" :
129
+ raise ValueError (f"Could not find { MSVCP140_SRC_PATH } ." )
130
+
123
131
if not op .isdir (wheel_dirname ):
124
132
raise RuntimeError (f"Could not find { wheel_dirname } file." )
125
133
126
134
vcomp140_dll_filename = op .basename (VCOMP140_SRC_PATH )
127
135
vcruntime140_dll_filename = op .basename (VCRUNTIME140_SRC_PATH )
128
136
vcruntime140_1_dll_filename = op .basename (VCRUNTIME140_1_SRC_PATH )
137
+ msvcp140_dll_filename = op .basename (MSVCP140_SRC_PATH )
129
138
130
139
target_folder = op .join (wheel_dirname , TARGET_FOLDER )
131
140
distributor_init = op .join (wheel_dirname , DISTRIBUTOR_INIT )
@@ -144,6 +153,9 @@ def main(wheel_dirname, bitness):
144
153
print (f"Copying { VCRUNTIME140_1_SRC_PATH } to { target_folder } ." )
145
154
shutil .copy2 (VCRUNTIME140_1_SRC_PATH , target_folder )
146
155
156
+ print (f"Copying { MSVCP140_SRC_PATH } to { target_folder } ." )
157
+ shutil .copy2 (MSVCP140_SRC_PATH , target_folder )
158
+
147
159
# Generate the _distributor_init file in the source tree
148
160
print ("Generating the '_distributor_init.py' file." )
149
161
if bitness == "32" :
@@ -156,6 +168,7 @@ def main(wheel_dirname, bitness):
156
168
vcomp140_dll_filename ,
157
169
vcruntime140_dll_filename ,
158
170
vcruntime140_1_dll_filename ,
171
+ msvcp140_dll_filename ,
159
172
)
160
173
161
174
0 commit comments