Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rez pip fails to execute in Windows after 2.94.0 #1120

Closed
salvaom opened this issue Sep 1, 2021 · 1 comment · Fixed by #1130
Closed

Rez pip fails to execute in Windows after 2.94.0 #1120

salvaom opened this issue Sep 1, 2021 · 1 comment · Fixed by #1130

Comments

@salvaom
Copy link

salvaom commented Sep 1, 2021

After 2.94.0 the rez pip command will result in an error on Windows when using powershell as the default shell.

I used the following command to test it: pip --install PySide6. You can clearly see the why on the rez-shell.ps1 script:

2.93.0

. "C:\Users\Salva\AppData\Local\Temp\rez_context_x0vn7fvx\context.ps1"
Function prompt {"[rez] $(Get-Location)> "}
$Env:PATHEXT = ((($Env:PATHEXT + ";.PY") -split ";") | Select-Object -Unique) -join ";"
h:\cache\skg\cache\python\3.7.7\5b53\a\python\python.exe -m pip install --use-pep517 --target=C:\Users\Salva\AppData\Local\Temp\pip-e5a3zl2z-rez PySide6
exit $LastExitCode

2.94.0

. "C:\Users\Salva\AppData\Local\Temp\rez_context_d71nj_ag\context.ps1"
Function prompt {"[rez] $(Get-Location)> "}
$Env:PATHEXT = ((($Env:PATHEXT + ";.PY") -split ";") | Select-Object -Unique) -join ";"
"h:\cache\skg\cache\python\3.7.7\5b53\a\python\python.exe" -m pip install --use-pep517 "--target=C:\Users\Salva\AppData\Local\Temp\pip-gbk3dqgz-rez" PySide6
exit $LastExitCode

Yielding the following error:

16:15:24 INFO     Installing 'PySide6' with pip taken from 'h:\\cache\\skg\\cache\\python\\3.7.7\\5b53\\a\\python\\python.exe'
At C:\Users\Salva\AppData\Local\Temp\rez_context_d71nj_ag\rez-shell.ps1:4 char:60
+ "h:\cache\skg\cache\python\3.7.7\5b53\a\python\python.exe" -m pip ins ...
+                                                            ~~
Unexpected token '-m' in expression or statement.
At C:\Users\Salva\AppData\Local\Temp\rez_context_d71nj_ag\rez-shell.ps1:4 char:63
+ ... cache\skg\cache\python\3.7.7\5b53\a\python\python.exe" -m pip install ...
+                                                               ~~~
Unexpected token 'pip' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

Adding a . before the command itself fixes the issue as powershell is then aware that the string is to be executed as a command, same as with the sourcing of the context on the first line of both scripts.

@nerdvegas
Copy link
Contributor

Ah, this looks like it's almost certainly been caused by #1115. Seems like quoting that python exe is causing pwsh to not recognise it as a command?

I'll make this priority, I'm doing some more dev start of next week and will look at this then, thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants