Skip to main content
added 13 characters in body
Source Link
AWoods
  • 376
  • 3
  • 13

Updating PIP and installing Packages while using specific location of pip:

I was getting an intermittent error "Access Denied" when using the simple comand line pip install <library> on some lab machines that were using pip from a c:\users\... folder instead of the c:\Program Files\Python folder for all users. Thanks to MultiplyByZer0 answer above I was able to implement a solution that specified the path to python and then run pip.

Here is the powershell script I use to force pip update and then install python libraries:

$fullPath = "C:\Program Files\Python38"
$thisApp = "python.exe"
$arguments = "-m pip install --upgrade pip"
$appPath = join-path $fullPath $thisApp
Start-Process $appPath $arguments  -Verb RunAs -Wait
$packages = @(  "pylint"
                "pillow"
                "pygame"
                "matplotlib"
                "pandas"
                "godirect")
foreach ($package in $packages)
   {
       Write-Host "Installing python Package" $package -ForegroundColor Yellow
       $arguments = "-m pip install $package"
       Start-Process $appPath $arguments  -Verb RunAs -Wait
   }

Updating PIP and installing Packages while using specific location of pip:

I was getting an intermittent error "Access Denied" on some lab machines that were using pip from a c:\users\... folder instead of the c:\Program Files\Python folder for all users. Thanks to MultiplyByZer0 answer above I was able to implement a solution that specified the path to python and then run pip.

Here is the powershell script I use to force pip update and then install python libraries:

$fullPath = "C:\Program Files\Python38"
$thisApp = "python.exe"
$arguments = "-m pip install --upgrade pip"
$appPath = join-path $fullPath $thisApp
Start-Process $appPath $arguments  -Verb RunAs -Wait
$packages = @(  "pylint"
                "pillow"
                "pygame"
                "matplotlib"
                "pandas"
                "godirect")
foreach ($package in $packages)
   {
       Write-Host "Installing python Package" $package -ForegroundColor Yellow
       $arguments = "-m pip install $package"
       Start-Process $appPath $arguments  -Verb RunAs -Wait
   }

Updating PIP and installing Packages while using specific location of pip:

I was getting an intermittent error "Access Denied" when using the simple comand line pip install <library> on some lab machines that were using pip from a c:\users\... folder instead of the c:\Program Files\Python folder for all users. Thanks to MultiplyByZer0 answer above I was able to implement a solution that specified the path to python and then run pip.

Here is the powershell script I use to force pip update and then install python libraries:

$fullPath = "C:\Program Files\Python38"
$thisApp = "python.exe"
$arguments = "-m pip install --upgrade pip"
$appPath = join-path $fullPath $thisApp
Start-Process $appPath $arguments  -Verb RunAs -Wait
$packages = @(  "pylint"
                "pillow"
                "pygame"
                "matplotlib"
                "pandas"
                "godirect")
foreach ($package in $packages)
   {
       Write-Host "Installing python Package" $package -ForegroundColor Yellow
       $arguments = "-m pip install $package"
       Start-Process $appPath $arguments  -Verb RunAs -Wait
   }
added 13 characters in body
Source Link
AWoods
  • 376
  • 3
  • 13

Updating PIP and installing Packages while using specific location of pip:

I was getting an intermittent error "Access Denied" on some lab machines that were using pip from a c:\users\... folder instead of the c:\Program Files\Python folder for all users. Thanks to MultiplyByZer0 answer above I was able to implement a solution that specified the path to python and then run pip.

Here is the Codepowershell script I use to force pip update and then install python libraries:

$fullPath = "C:\Program Files\Python38"
$thisApp = "python.exe"
$arguments = "-m pip install --upgrade pip"
$appPath = join-path $fullPath $thisApp
Start-Process $appPath $arguments  -Verb RunAs -Wait
$packages = @(  "pylint"
                "pillow"
                "pygame"
                "matplotlib"
                "pandas"
                "godirect")
foreach ($package in $packages)
   {
       Write-Host "Installing python Package" $package -ForegroundColor Yellow
       $arguments = "-m pip install $package"
       Start-Process $appPath $arguments  -Verb RunAs -Wait
   }

Updating PIP and installing Packages while using specific location of pip:

I was getting an intermittent error "Access Denied" on some lab machines that were using pip from a c:\users\... folder instead of the c:\Program Files\Python folder for all users. Thanks to MultiplyByZer0 answer above I was able to implement a solution that specified the path to python and then run pip.

Here is the Code I use to force pip update and then install python libraries:

$fullPath = "C:\Program Files\Python38"
$thisApp = "python.exe"
$arguments = "-m pip install --upgrade pip"
$appPath = join-path $fullPath $thisApp
Start-Process $appPath $arguments  -Verb RunAs -Wait
$packages = @(  "pylint"
                "pillow"
                "pygame"
                "matplotlib"
                "pandas"
                "godirect")
foreach ($package in $packages)
   {
       Write-Host "Installing python Package" $package -ForegroundColor Yellow
       $arguments = "-m pip install $package"
       Start-Process $appPath $arguments  -Verb RunAs -Wait
   }

Updating PIP and installing Packages while using specific location of pip:

I was getting an intermittent error "Access Denied" on some lab machines that were using pip from a c:\users\... folder instead of the c:\Program Files\Python folder for all users. Thanks to MultiplyByZer0 answer above I was able to implement a solution that specified the path to python and then run pip.

Here is the powershell script I use to force pip update and then install python libraries:

$fullPath = "C:\Program Files\Python38"
$thisApp = "python.exe"
$arguments = "-m pip install --upgrade pip"
$appPath = join-path $fullPath $thisApp
Start-Process $appPath $arguments  -Verb RunAs -Wait
$packages = @(  "pylint"
                "pillow"
                "pygame"
                "matplotlib"
                "pandas"
                "godirect")
foreach ($package in $packages)
   {
       Write-Host "Installing python Package" $package -ForegroundColor Yellow
       $arguments = "-m pip install $package"
       Start-Process $appPath $arguments  -Verb RunAs -Wait
   }
Source Link
AWoods
  • 376
  • 3
  • 13

Updating PIP and installing Packages while using specific location of pip:

I was getting an intermittent error "Access Denied" on some lab machines that were using pip from a c:\users\... folder instead of the c:\Program Files\Python folder for all users. Thanks to MultiplyByZer0 answer above I was able to implement a solution that specified the path to python and then run pip.

Here is the Code I use to force pip update and then install python libraries:

$fullPath = "C:\Program Files\Python38"
$thisApp = "python.exe"
$arguments = "-m pip install --upgrade pip"
$appPath = join-path $fullPath $thisApp
Start-Process $appPath $arguments  -Verb RunAs -Wait
$packages = @(  "pylint"
                "pillow"
                "pygame"
                "matplotlib"
                "pandas"
                "godirect")
foreach ($package in $packages)
   {
       Write-Host "Installing python Package" $package -ForegroundColor Yellow
       $arguments = "-m pip install $package"
       Start-Process $appPath $arguments  -Verb RunAs -Wait
   }