When you run a CMD file from PowerShell, it's run by CMD.exe not by PowerShell. The error message is coming from Python.
This is not a PowerShell problem.