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
Running pip-sync with --python-executable, I was baffled as to why it was attempting to remove items from the local directory (any environment) and the user site directory (python-build-standalone environments with no virtual env present).
I eventually realised it was due to the following problem: even though pip-sync was being executed from a Python runtime configured to use isolated mode (no implied sys.path[0], no user site directory), the same was not true when pip-sync invoked the given Python executable to check the value of sys.path.
This means actually performing the sync in an isolated environment requires setting the relevant Python environment variables rather relying than solely on the -I command line flag:
PYTHONNOUSERSITE=1
PYTHONSAFEPATH=1
The text was updated successfully, but these errors were encountered:
Running
pip-sync
with--python-executable
, I was baffled as to why it was attempting to remove items from the local directory (any environment) and the user site directory (python-build-standalone environments with no virtual env present).I eventually realised it was due to the following problem: even though
pip-sync
was being executed from a Python runtime configured to use isolated mode (no implied sys.path[0], no user site directory), the same was not true whenpip-sync
invoked the given Python executable to check the value ofsys.path
.This means actually performing the sync in an isolated environment requires setting the relevant Python environment variables rather relying than solely on the
-I
command line flag:The text was updated successfully, but these errors were encountered: