You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use python -Im pip, the -I is not passed to build env, and the unwanted sys.path is not exclude. I'm not sure whether this is the expected behavior, because I know some pip args also not passed to build env as mentioned in #9081.
I encountered a rare case where the pipeline agent has Python 3.12.6 installed, and I'm trying to use embedded Python 3.12.7. There seems to be a compatibility issue between versions 3.12.6 and 3.12.7; running python.exe -m pip fails with return code 50075, but python.exe -Im pip works fine. However, in the build env, since -I is not passed, when use pep517 build, pip fails with 57005.
I wonder if this possible to honor this isolated flag in build env.
Using pip 24.2 from D:\a\_work\1\s\artifacts\Python\Lib\site-packages\pip (python 3.12)
Non-user install because user site-packages disabled
Created temporary directory: C:\Users\cloudtest\AppData\Local\Temp\pip-build-tracker-9hjc5ufp
Initialized build tracking at C:\Users\cloudtest\AppData\Local\Temp\pip-build-tracker-9hjc5ufp
Created build tracker: C:\Users\cloudtest\AppData\Local\Temp\pip-build-tracker-9hjc5ufp
Entered build tracker: C:\Users\cloudtest\AppData\Local\Temp\pip-build-tracker-9hjc5ufp
Created temporary directory: C:\Users\cloudtest\AppData\Local\Temp\pip-install-8u39htfy
Created temporary directory: C:\Users\cloudtest\AppData\Local\Temp\pip-ephem-wheel-cache-0fijydv4
Processing d:\a\_work\1\s\src\azure-cli
Added file:///D:/a/_work/1/s/src/azure-cli to build tracker 'C:\\Users\\cloudtest\\AppData\\Local\\Temp\\pip-build-tracker-9hjc5ufp'
Created temporary directory: C:\Users\cloudtest\AppData\Local\Temp\pip-build-env-trza6ryi
Installing build dependencies: started
Running command pip subprocess to install build dependencies
error: subprocess-exited-with-error
pip subprocess to install build dependencies did not run successfully.
exit code: 57005
See above for output.
The only real workaround to pass in something to an isolated build is to export environmental variables.
So you would need to go through each option and where possible set what you though was best, e.g. PYTHONNOUSERSITE=1, PYTHONSAFEPATH=1.
I don't know whether this was considered in the design of isolated build mode, one could see why it might be a good thing to have Python isolated mode on by default for isolated builds, but there may be a good reason it isn't.
PYTHONNOUSERSITE=1 equals -s, and PYTHONSAFEPATH=1 equals -P.
Although the sys.path doc does not explain why C:\\hostedtoolcache\\windows\\Python\\3.12.6\\x64\\Lib is in the path, it can be removed with -E option.
-E
Ignore all PYTHON* environment variables, e.g. PYTHONPATH and PYTHONHOME, that might be set.
Since -E means ignore PYTHON* env, so I don't think there is an alternative env variable for this option.
Finally, I managed to remove C:\\hostedtoolcache\\windows\\Python\\3.12.6\\x64\\Lib by explicitly set PYTHONHOME to embedded Python directory.
Description
When I use
python -Im pip
, the-I
is not passed to build env, and the unwantedsys.path
is not exclude. I'm not sure whether this is the expected behavior, because I know some pip args also not passed to build env as mentioned in #9081.I encountered a rare case where the pipeline agent has Python 3.12.6 installed, and I'm trying to use embedded Python 3.12.7. There seems to be a compatibility issue between versions 3.12.6 and 3.12.7; running
python.exe -m pip
fails with return code50075
, butpython.exe -Im pip
works fine. However, in the build env, since-I
is not passed, when use pep517 build, pip fails with57005
.I wonder if this possible to honor this isolated flag in build env.
Related issue: Azure/azure-cli#29887
Expected behavior
pip can also use isolated flag in build env
pip version
24.2
Python version
3.12.7
OS
Windows
How to Reproduce
It seems
-I
is not passed in build env.pip/src/pip/_internal/build_env.py
Lines 227 to 248 in ec5faea
Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: