actions / setup-python

Set up your GitHub Actions workflow with a specific version of Python
MIT License
1.59k stars 507 forks source link

setup-python succeeds but python version not used in following steps (self-hosted) #805

Closed JonathanRenon-EDB closed 4 months ago

JonathanRenon-EDB commented 5 months ago

Description: setup-python runs successfully but is not being used by default in following steps. the environment variable seem correctly set and running /opt/hostedtoolcache/Python/3.9.18/x64/python --version shows the correct version whereas python --version returns 3.10.12 I understand the issue might also be in the self-hosted runner configuration but not sure what could cause it to ignore environment variable set by setup-python.

Action version: v4 or v5

Platform:

Runner type:

Tools version:

python-version: 3.9 Repro steps:
using self-hosted (aws) ubuntu-22.04 runner use setup-python with version 3.9

Expected behavior: setup-python successfully runs and following steps use the specified version by default

Actual behavior: setup-python successfully runs and following steps use stock version (here 3.10) of the runner

HarithaVattikuti commented 5 months ago

Hello @JonathanRenon-EDB, Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

priyagupta108 commented 4 months ago

Hi, @JonathanRenon-EDB 👋 !  Based on the provided information, it seems the issue might be with the runner's PATH configuration or the default shell on the runner. Here are a few things you can try:

- name: Print PATH
  run: echo $PATH
- name: Adjust PATH
  run: echo "/opt/hostedtoolcache/Python/3.9.18/x64/bin:$PATH" >> $GITHUB_PATH

However, without more specifics such as the content of the workflow file or any error messages that might be appearing, it's challenging to determine the exact cause of the issue. Any additional details you could provide would be very helpful :)

priyagupta108 commented 4 months ago

Hello @JonathanRenon-EDB 👋 , just a gentle reminder regarding this issue. If you have any updates or need further assistance, please let us know :)

JonathanRenon-EDB commented 4 months ago

Hello, Thanks for the input, I won't be able to provide more information, I'm not managing the runner myself, the PATH was tested and looked good, as you stated it's probably a shell configuration issue. there is no point keeping the ticket opened here. thank you for the time spent.