'CommandNotFoundException' while CI pipeline running in python project

Question:

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?

Asked By: Keith

||

Answers:

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.

Answered By: ofaurax
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.