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
run rez env python -- python -m venv C:\rez-pip to generate a virtualenv that will host the rez-pip package
run cd C:\rez-pip\Scripts then .\activate to enter the virtualenv
run python -m pip install rez-pip to install rez-pip in the virtualenv
Through the Windows Configuration panel, add "C:\foo" at the end of your PATH environment variable
open a terminal
run cd C:\rez-pip\Scripts then .\activate to enter the virtualenv of rez-pip
run .\rez-pip2.exe future
see the error:
> .\rez-pip2.exe future
INFO Installing requested packages for Python 3.7.7
Traceback (most recent call last):
File "\\ ... \packages\python\3.9.10\platform-windows\arch-AMD64\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "\\ ... \packages\python\3.9.10\platform-windows\arch-AMD64\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\rez-pip\Scripts\rez-pip2.exe\__main__.py", line 7, in <module>
File "C:\rez-pip\lib\site-packages\rez_pip\cli.py", line 318, in run
_run(args, pipArgs, pipWorkArea)
File "C:\rez-pip\lib\site-packages\rez_pip\cli.py", line 176, in _run
packages = rez_pip.pip.getPackages(
File "C:\rez-pip\lib\site-packages\rez_pip\pip.py", line 106, in getPackages
process = subprocess.Popen(
File "\\ ... \packages\python\3.9.10\platform-windows\arch-AMD64\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "\\ ... \packages\python\3.9.10\platform-windows\arch-AMD64\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 193] %1 not a valid Win32 application
Expected behavior
Program installs future as a rez package.
Actual behavior
The exception above occurs.
Investigation
The error is due to this line checking for a "python3.exe" in PATH before checking for "python.exe". The empty python3.exe we created gets found before the python.exe of our rezified python.
Possible suggestions
If the rezified python package provides python in its tools section, directly use "python" instead of attempting "python3.7", "python3" then "python"
check that the result of which is a under the root of a rezified python package
Note
IMO being able to use an arbitrary python executable instead of the one provided by a rezified python package could be interesting, but it should be an explicit behaviour requested by the user; the default behavior of rez-pip should be to only use a rezified python package.
The text was updated successfully, but these errors were encountered:
Attempting to pass parent_environ={} to which (here) doesn't work because ultimately the ResolvedContext object creates a RexExecutor that appends PATH anyway. See here to check the call stack at the point where PATH gets added
In some cases, rez-pip can unexpectedly use a python executable found on your machine instead of a rezified python package.
Environment
To Reproduce
python3.exe
in some arbitrary folder, e.g. "C:\foo\python3.exe"rez env python -- python -m venv C:\rez-pip
to generate a virtualenv that will host the rez-pip packagecd C:\rez-pip\Scripts
then.\activate
to enter the virtualenvpython -m pip install rez-pip
to install rez-pip in the virtualenvcd C:\rez-pip\Scripts
then.\activate
to enter the virtualenv ofrez-pip
.\rez-pip2.exe future
Expected behavior
Program installs future as a rez package.
Actual behavior
The exception above occurs.
Investigation
The error is due to this line checking for a "python3.exe" in PATH before checking for "python.exe". The empty python3.exe we created gets found before the python.exe of our rezified python.
Possible suggestions
python
in itstools
section, directly use "python" instead of attempting "python3.7", "python3" then "python"which
is a under theroot
of a rezified python packageNote
IMO being able to use an arbitrary python executable instead of the one provided by a rezified python package could be interesting, but it should be an explicit behaviour requested by the user; the default behavior of rez-pip should be to only use a rezified python package.
The text was updated successfully, but these errors were encountered: