I'm trying to write a powershell script which will install Python and then proceed with pip package, conan, installation. The installation works successfully however the name conan is not recognized The term 'conan' is not recognized as the name of a cmdlet
.
Write-Host "Installing python"
Start-Process C:\CppBuildTools\Python\python-3.10.7-amd64.exe '/quiet InstallAllUsers=1 PrependPath=1' -wait
Write-Host "python installation completed successfully"
Write-Host "Reload environment variables"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
Write-Host "Reloaded environment variables"
Write-Host "Installing conan"
pip install conan
Write-Host "conan installation completed successfully"
This script installs Python for all users and adds it to the PATH. It seems everything is as expected so far, however when executing pip install conan
there's already a strange log Defaulting to user installation because normal site-packages is not writeable
. This log is not present when installing Python with GUI installer for all users and adding to Path option and then installing conan with pip install conan
. Can someone help me understand what's the difference when using powershell script?