I want to run my Jupyter notebooks with my pipeline. To do this i need runipy. And to install runipy on the gitlab runner i need python. But when i want to run the .gitlab-ci.yml script it gets stuck at printing the python version because python is not recognized.
.gitlab-ci.yml:
image: python:3.9
before_script:
- python -V
- pip install runipy
error:
Running with gitlab-runner 13.3.1 (738bbe5a)
on JavaUnitTestRunner vr_SgzNd
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:01
Running on DESKTOP-DJVC49J...
Getting source from Git repository
00:03
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in C:/Gitlab-Runner/builds/vr_SgzNd/0/I438220/pharma/.git/
Checking out 65a225c0 as pipeline...
git-lfs/2.9.2 (GitHub; windows amd64; go 1.12.7; git 0274d856)
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:02
$ python -V
python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\WINDOWS\TEMP\build_script377697220\script.ps1:195 char:1
+ python -V
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
ERROR: Job failed: exit status 1
When i try the same command in cmd everything works just fine.
pre_build_script. I tried to change the path to the location where python is installed. But that didn't help either. Also i tried to add the path to the path variables in the control panel, But also no success. Then i tried to add the path in the gitlab-ci file itself. And that resulted in this error:The term 'git' is not recognized.environment = ['PATH=%PATH%;C:/Program Files/Git/bin;C:\Users\{user}\AppData\Local\Programs\Python\Python39;C:\Users\{user}\AppData\Local\Programs\Python\Python39\Scripts']to the config.toml file did the trick. Thank you so much for the help. :)