Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running python on MacOS runner is always 2.7 #632

Closed
2 of 5 tasks
stefmolin opened this issue Mar 25, 2023 · 1 comment
Closed
2 of 5 tasks

Running python on MacOS runner is always 2.7 #632

stefmolin opened this issue Mar 25, 2023 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@stefmolin
Copy link

Description:
Despite specifying the version of Python to be 3.x, the MacOS runner is interpreting python as Python 2.7.

Action version:
4

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

3.9, 3.10, 3.11

Repro steps:

jobs:
  build:
    name: Python ${{ matrix.python-version }}, ${{ matrix.os }}

    runs-on: ${{ matrix.os }}

    defaults:
      run:
        shell: bash -el {0}

    strategy:
        fail-fast: false
        matrix:
            os: [macos-latest, ubuntu-latest, windows-latest]
            python-version: ["3.9", "3.10", "3.11"]

    steps:
      - uses: actions/checkout@v3

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
          cache: pip

      - name: Install
        run: |
          python -m pip install --upgrade pip
          python -m pip install setuptools --upgrade
          python -m pip install .

      - name: Diagnostics
        run: |
          which python
          python -m pip --version

Expected behavior:
The logic works on the Linux and Windows runners because python is properly set up. I would expect python on MacOS to also use the version that was set up with the action.

Actual behavior:
python on the MacOS runner is using 2.7:

Run which python
  which python
  python -m pip --version
  shell: /bin/bash -el {0}
  env:
    pythonLocation: /Users/runner/hostedtoolcache/Python/3.11.[2](#step:5:2)/x64
    PKG_CONFIG_PATH: /Users/runner/hostedtoolcache/Python/[3](#step:5:3).11.2/x6[4](#step:5:4)/lib/pkgconfig
    Python_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.11.2/x[6](#step:5:6)4
    Python2_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.11.2/x64
    Python3_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.11.2/x64
/usr/local/bin/python
pip 20.3.4 from /Library/Frameworks/Python.framework/Versions/2.[7](#step:5:7)/lib/python2.7/site-packages/pip (python 2.7)
@stefmolin stefmolin added bug Something isn't working needs triage labels Mar 25, 2023
@stefmolin
Copy link
Author

This comment fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant