Search code examples
pythongitlab-ci-runner

'CommandNotFoundException' while CI pipeline running in python project


I am preparing a pipeline for my Python project. There is a script:

image: python:3.7.9

stages:
    - test

run_ui_tests:
    tags:
        - es-test
        - est
    stage: test
    before_script:
        - echo "Prepairing enviroment"
        - python --version
    script:
        - echo "Executing ui tests..."
        - cd cio_tests
        - dir
        - pytest -v
    after_script:
        - echo "Cleaning test catalogue..."

An error occurs while executing the script. Error is: enter image description here

Pythonpath already added to system variables (Win 10). What is the reason for this error?


Solution

  • We can't see the message "Prepairing enviroment", are you sure you are running this .gitlab-ci.yml?

    You appear to be running a windows powershell runner.

    Try to add - echo $env:PATH before your call to python, to ensure the PATH is correct.