0

I am struggeling setting up a CI/CD pipeline with a runner on windows using the powershell. When trying to run a python script within the repo like py hardware_in_the_loop_base.py 2060365E3452 it fails with "Can't find a default Python."

I added the output of py -0 to the runners config.toml with pre_build_script = "$Env:PATH += \";C:\\Users\\user_name\\AppData\\Local\\Programs\\Python\\Python310\"" but it did not change anything.

1 Answers1

0

I managed to figure it out. The problem was that if I opened the PowerShell from my user account and ran the py hardware_in_the_loop_base.py 2060365E3452 command, the Windows Python Launcher (py.exe) ran the script with the python instance installed only for my user (which worked fine). On the other hand, the GitLab runner has other user privileges and py.exe did not find python installed for all user as the was none. I uninstalled Python in my user account and reinstalled it for all users as described here:

Make Python Available to All Users When Already Installed only for One