File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -2235,31 +2235,42 @@ def build_cpython(
2235
2235
os .environ ,
2236
2236
)
2237
2237
2238
+ # We install pip by using pip to install itself. This leverages a feature
2239
+ # where Python can automatically recognize wheel/zip files on sys.path and
2240
+ # import their contents. According to
2241
+ # https://github.com/pypa/pip/issues/11146 running pip from a wheel is not
2242
+ # supported. But it has historically worked and is simple. So do this until
2243
+ # it stops working and we need to switch to running pip from the filesytem.
2244
+ pip_env = dict (os .environ )
2245
+ pip_env ["PYTHONPATH" ] = str (pip_wheel )
2246
+
2238
2247
# Install pip and setuptools.
2239
2248
exec_and_log (
2240
2249
[
2241
2250
str (install_dir / "python.exe" ),
2242
- str (pip_wheel / "pip" ),
2251
+ "-m" ,
2252
+ "pip" ,
2243
2253
"install" ,
2244
2254
"--no-cache-dir" ,
2245
2255
"--no-index" ,
2246
2256
str (pip_wheel ),
2247
2257
],
2248
2258
td ,
2249
- os . environ ,
2259
+ pip_env ,
2250
2260
)
2251
2261
2252
2262
exec_and_log (
2253
2263
[
2254
2264
str (install_dir / "python.exe" ),
2255
- str (pip_wheel / "pip" ),
2265
+ "-m" ,
2266
+ "pip" ,
2256
2267
"install" ,
2257
2268
"--no-cache-dir" ,
2258
2269
"--no-index" ,
2259
2270
str (setuptools_wheel ),
2260
2271
],
2261
2272
td ,
2262
- os . environ ,
2273
+ pip_env ,
2263
2274
)
2264
2275
2265
2276
# The executables in the Scripts/ directory don't work because they reference
You can’t perform that action at this time.
0 commit comments