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
The pex.resolver module delegates work to pip by running a pip PEX in a subprocess. If the interpreter being resolved for is not the current interpreter and the current interpreter has portions of its stdlib exported on the PYTHONPATH and those portions of the stdlib are incompatible with the interpreter being resolved for, the bootstrap of the pip PEX will fail before it can scrub away the PYTHONPATH.
A minimal repro:
$ python3.8 <<EOF
> import os
> import sys
>
>
> # This puts python3.8 stdlib on PYTHONPATH.
> os.environ['PYTHONPATH'] = os.pathsep.join(sys.path)
>
>
> from pex import resolver
> from pex.interpreter import PythonInterpreter
>
>
> def find_python36():
> for interp in PythonInterpreter.iter():
> if interp.version[:2] == (3, 6):
> return interp
> raise RuntimeError('This test requires python3.6 be on the PATH.')
>
>
> result = resolver.resolve(requirements=['packaging==19.2'], interpreter=find_python36())
> print('Resolved: {}'.format(result))
> EOF
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
File "/usr/lib/python3.8/abc.py", line 64, in <module>
ModuleNotFoundError: No module named '_abc'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/io.py", line 52, in <module>
File "/usr/lib/python3.8/abc.py", line 68, in <module>
File "/usr/lib/python3.8/_py_abc.py", line 35
def __new__(mcls, name, bases, namespace, /, **kwargs):
^
SyntaxError: invalid syntax
Traceback (most recent call last):
File "<stdin>", line 20, in <module>
File "/home/jsirois/dev/pantsbuild/pex/pex/resolver.py", line 701, in resolve
return list(resolve_request.resolve_distributions(ignore_errors=ignore_errors))
File "/home/jsirois/dev/pantsbuild/pex/pex/resolver.py", line 498, in resolve_distributions
for resolve_result in self._run_parallel(inputs=to_resolve,
File "/home/jsirois/dev/pantsbuild/pex/pex/resolver.py", line 366, in _run_parallel
for result in execute_parallel(
File "/home/jsirois/dev/pantsbuild/pex/pex/jobs.py", line 219, in execute_parallel
raise error
pex.resolver.Unsatisfiable: pid: 13111 -> /usr/bin/python3.6 /tmp/tmp6ghsjpkj --disable-pip-version-check --isolated --exists-action i -q --no-cache-dir download --dest /tmp/tmpk4po5m_6/resolved_dists/cp36-cp36m packaging==19.2 raised Executing /usr/bin/python3.6 /tmp/tmp6ghsjpkj --disable-pip-version-check --isolated --exists-action i -q --no-cache-dir download --dest /tmp/tmpk4po5m_6/resolved_dists/cp36-cp36m packaging==19.2 failed with -6
The text was updated successfully, but these errors were encountered:
As described in pex-tool#892, when the Pex resolver API is used in-process, a
sufficiently antagonistic PYTHONPATH could lead to a failure to launch
the pip PEX we delegate resolving to. Fix this by scrubbing PYTHONPATH
from the pip PEX environment pre-launch.
Fixespex-tool#892
As described in pex-tool#892, when the Pex resolver API is used in-process, a
sufficiently antagonistic PYTHONPATH could lead to a failure to launch
the pip PEX we delegate resolving to. Fix this by scrubbing PYTHONPATH
from the pip PEX environment pre-launch.
Fixespex-tool#892
As described in #892, when the Pex resolver API is used in-process, a
sufficiently antagonistic PYTHONPATH could lead to a failure to launch
the pip PEX we delegate resolving to. Fix this by scrubbing PYTHONPATH
from the pip PEX environment pre-launch.
Fixes#892
The
pex.resolver
module delegates work to pip by running a pip PEX in a subprocess. If the interpreter being resolved for is not the current interpreter and the current interpreter has portions of its stdlib exported on thePYTHONPATH
and those portions of the stdlib are incompatible with the interpreter being resolved for, the bootstrap of the pip PEX will fail before it can scrub away thePYTHONPATH
.A minimal repro:
The text was updated successfully, but these errors were encountered: