Attempting to run mkvirtualenv __name_of_env__ when the python path contains "Program Files (x86)" results in an error: The term 'x86' is not recognized as the name of a cmdlet ....
I have a branch with a fix and can open a PR if you'd like, diff output below:
diff --git a/VirtualEnvWrapper.psm1 b/VirtualEnvWrapper.psm1
index f3b43dd..76d210d 100644
--- a/VirtualEnvWrapper.psm1
+++ b/VirtualEnvWrapper.psm1
@@ -73,7 +73,7 @@ function Get-PythonVersion($Python) {
return
}
- $python_version = Invoke-Expression "$Python --version 2>&1"
+ $python_version = Invoke-Expression "& '$Python' --version 2>&1"
if (!$Python -and !$python_version) {
Write-Host "I don't find any Python version into your path" -ForegroundColor Red
return
@@ -130,7 +130,7 @@ function New-Python3Env($Python, $Name) {
$PythonExe = Join-Path (Split-Path $Python -Parent) "python.exe"
}
- $Command = "$PythonExe -m venv"
+ $Command = "& '$PythonExe' -m venv"
Invoke-CreatePyEnv $Command $Name
}
Attempting to run
mkvirtualenv __name_of_env__
when the python path contains "Program Files (x86)" results in an error:The term 'x86' is not recognized as the name of a cmdlet ...
.I have a branch with a fix and can open a PR if you'd like, diff output below: