Help with UAC prompt

I’m running this script in python and on one computer it is triggering a UAC prompt but on another computer it doesn’t and I can’t figure out why.

import os
import subprocess

# os.chdir(r'C:\Users\phpjunkie\Python')
stdout, stderr = subprocess.Popen([
    'pip',
    'list',
    '-o',
], stdout = subprocess.PIPE, stderr = subprocess.PIPE, text = True).communicate()

print(stdout)
print()

packages = [line[0:line.index(' ')] for line in stdout.split('\n')[2:] if 'phpjunkie' not in line and 'pip' not in line and 'opencv' not in line and bool(len(line))]
if not bool(len(packages)):
    input('\33[1;92mAll packages are up to date ...\n\33[1;97mPress any key to exit ...')
    exit()

for package in packages:
    print(package)
print()

for package in packages:
    returncode = subprocess.call([
        'pip',
        'install',
        '--upgrade',
        f'{package}'
    ], shell = True)
    if returncode:
        input(f'\33[1;91mProcess finished with exit code {returncode}.\n\33[1;97mPress any key to continue ...')
        exit()
    print()


input('\33[1;97mPress any key to exit ...')

I want this to run in the terminal but it can’t on my Alienware 'cause for some reason it is triggering the UAC prompt and asking for admin privileges.

What happens if you try using the corresponding commands at a command prompt on each computer?

What Python is being used on each computer, and how is that copy of Python installed on each computer?

It is all the same on both computers. Same Python version, same settings during installation, same folder in %userprofile%, same account, same password for the account, same configuration in the terminal, same version of windows.

Okay, and my first question?

It doesn’t seem to matter what I run on my Alienware. Everything is triggering a UAC Prompt.

One thing I did notice is that PyCharm on my Alienware asks every time for elevation of the folder on creating a new project but on my G7 it doesn’t.

I’m stumped.

That sounds like a Windows setting, something in your Local Security Policy. Probably something Alienware enables in their build process.

I got it figured out. py.exe needed to be set to run as admin during installation and it was the reason all of my scripts were requesting elevated privileges.